steveblue / angular2-rollup

CLI for bundling Angular with Rollup and Closure Compiler
121 stars 18 forks source link

Use new Angular es2015 FESM bundles? #13

Closed kylecordes closed 7 years ago

kylecordes commented 7 years ago

Steve - I don't know if this might be useful, I'm entering it as an issue to keep track of it easily.

I have something similar going, though less complex than yours:

https://github.com/OasisDigital/angular-aot-es2015-rollup

It looks like yours uses the "modules" setting in rollup-plugin-node-resolve, so it's getting the ES5-in-ES2015-modules FESM files. Mine was also, but I saw that they also publish ES2015-in-ES2015-modules FESM files, that results in a slightly smaller final bundle size by delaying the 2015-to-5 completion until later step.

I have a PR in rollup-plugin-node-resolve:

https://github.com/rollup/rollup-plugin-node-resolve/pull/85

To add this feature under the flag "es2015", and in the meantime I published a fork with that could change in it:

https://www.npmjs.com/package/@oasisdigital/rollup-plugin-node-resolve

steveblue commented 7 years ago

Added rollup-plugin-node-resolve-angular package to the project and it is working great @kylecordes on this branch. Will be testing it out this week, but so far seems like it works. I'm able to get the boilerplate bundle in this repository to load in under 450ms. The branch in the link also contains a new build for distributing Libraries based off the talk on Day 3 @ngconf. I will be merging it into master when it passes muster in all my projects.

kylecordes commented 7 years ago

@steveblue If I understand right, at ng-conf last week the core team again mentioned that they are publishing things this way, including with the "es2015" field to mark these files, and they encouraged library authors to do the same. So I have high hopes that this will emerge to become somewhat accepted standard and end up in the core default node resolve. In the meantime, my fork seems to be the right thing to use.

steveblue commented 7 years ago

This feature has been merged into master. Closing.