-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Asset Build Tool #17262
base: main
Are you sure you want to change the base?
New Asset Build Tool #17262
Conversation
# Conflicts: # src/OrchardCore.Modules/OrchardCore.AdminDashboard/Assets.json # src/OrchardCore.Modules/OrchardCore.AdminMenu/Assets.json # src/OrchardCore.Modules/OrchardCore.AdminMenu/wwwroot/Scripts/admin-menu-icon-picker.js # src/OrchardCore.Modules/OrchardCore.Media/ResourceManifestOptionsConfiguration.cs # src/OrchardCore.Modules/OrchardCore.Resources/package.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"action": "sass", | ||
"name": "admin-dashboard", | ||
"source": "Assets/scss/dashboard.scss", | ||
"dest": "wwwroot/Styles/", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be (and Scripts) the default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could surely do that.
src/OrchardCore.Modules/OrchardCore.AdminMenu/Views/Menu/List.cshtml
Outdated
Show resolved
Hide resolved
"cleanup": "node .scripts/cleanup.js", | ||
"build": "asset-bundler build", | ||
"copy": "asset-bundler copy", | ||
"watch": "asset-bundler watch", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that I'm not providing any Asset2.json bundler configuration yet.
- I will need to add an example.
- Will need to add a null check there so that it doesn't show this error message.
src/OrchardCore.Modules/OrchardCore.AdminMenu/package-lock.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did these change if the module is not yet updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think it is because it is using Yarn latest version and it is resolving different version of dependencies/packages.
Co-authored-by: Zoltán Lehóczky <[email protected]>
…MS/OrchardCore into skrypt/asset-build-tool
Some extra work for me on Christmas holidays.🎅🏼
Assets Build Tool
Created by @jptissot
Based on Concurrently and Parcel but can also run Vite and probably Webpack too (untested). This is a non-opiniated build tool which allows to be extended for any asset compiler/bundler that someone may require.
This build tool essentially uses
Concurrently
instead ofGulp
.Concurrently
, is a concurrent shell runner which allows to trigger any possible shell command. It allows to triggerParcel
,Vite
,Gulp
or any other command that we need for building assets. Everything is written as ES6 modules (.mjs files).Kind of needed for Vue 3 migration because it needs to use either
Vite
orParcel
to build as ES6 modules.Old assets are not compiled as ES6 modules so they don't need these bundlers. For that matter I kept the old gulpfile.js which will be now triggered by
Concurrently
.What needs to be done over time is to migrate these javascript files to ES6 modules (.mjs files or .ts files) so that we can compile them as modules. But that's a migration that will happen over time.
Features
yarn build
yarn build -n module-name
yarn watch -n module-name
yarn build -g
yarn build -gr
Update
Finally, I'm keeping the old gulp pipeline because there is nothing wrong with it. Also, for backward compatibility with older modules that requires it. I'm using
Assets2.json
for the new build tool simply. This way, no need to migrate to the new build tool. I'm simply triggeringgulp rebuild
withConcurrently
in the new asset build tool. Because that's what it is essentially, a concurrent shell runner. This way, it is going to be a softer migration for those who already have modules that are built with the old gulp pipeline.Of course, this PR needs to be accepted by community first.
TODO
@jptissot @deanmarcussen @aderderian