-
Notifications
You must be signed in to change notification settings - Fork 12k
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
feat(@angular-devkit/build-angular): add experimentalRollupPass #15690
Conversation
0bf71ec
to
4f31795
Compare
4f31795
to
a5e6ca9
Compare
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
// Adapted from https://github.com/erikdesjardins/webpack-rollup-loader/blob/master/index.js |
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 module resolution logic and base plugin architecture were taken from https://github.com/erikdesjardins/webpack-rollup-loader.
We'll need to either include the original MIT license, or contribute a more general purpose setup back to the original project and use that instead of this modification. I've contacted the author in erikdesjardins/webpack-rollup-loader#25.
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.
Resolved by adding an additional license header crediting the original author and license as of used SHA:
/**
* @license
* @author Erik Desjardins
* Forked as of SHA 10fb020f997a146725963b202d79290c8798a7a0 from https://github.com/erikdesjardins/webpack-rollup-loader.
* Licensed under a MIT license.
* See https://github.com/erikdesjardins/webpack-rollup-loader/blob/10fb020f997a146725963b202d79290c8798a7a0/LICENSE for full license.
*/
In a angular.io I saw a 164 kb total size reduction, of which 160 kb were in the main bundle. The app still seemed to work afterwards.
|
Blocking on reaching a resolution to the licensing issue in #15690 (comment). |
299f370
to
dd372a7
Compare
// Bundle with Rollup | ||
const rollupOptions = { | ||
...options, | ||
input: entryId, |
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.
Question: should we disable treeshaking, such as pure functional calls removals if scripts optimisation is false?
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.
I think we don't even want to use this if script optimization if false. But I haven't gotten around to further matching options into the rollup pass. I think it makes more sense to do that later after we start getting feedback from its shortcomings. We might have to add a lot of config then.
In applications that make heavy use of lazy routes and ES2015 libraries, this option can improve bundle sizes. It might also break your bundles in ways we don't understand fully, so please test and report any problems you find. NOTE: the following are known problems with experimentalRollupPass - vendorChunk, commonChunk, namedChunks: these won't work, because by the time webpack sees the chunks, the context of where they came from is lost. - webWorkerTsConfig: workers must be imported via a root relative path (e.g.`app/search/search.worker`) instead of a relative path (`/search.worker`) because of the same reason as above. - loadChildren string syntax: doesn't work because rollup cannot follow the imports.
dd372a7
to
1d79a93
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
In applications that make heavy use of lazy routes and ES2015 libraries, this option can improve bundle sizes. It might also break your bundles in ways we don't understand fully, so please test and report any problems you find.
NOTE: the following are known problems with experimentalRollupPass
app/search/search.worker
) instead of a relative path (/search.worker
) because of the same reason as above.