Skip to content
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

Working Solution?? #1

Open
mfreeman-xtivia opened this issue Mar 14, 2017 · 7 comments
Open

Working Solution?? #1

mfreeman-xtivia opened this issue Mar 14, 2017 · 7 comments

Comments

@mfreeman-xtivia
Copy link

So I am really intrigued by your potential solution here as it may solve a pressing need i have to bust an ngc-compiled Angular 2 application up into three bundles--(1) polyfills (2) vendor and (3) app. And I really want to use Rollup instead of Webpack as Webpack makes my head hurt.

So I notice this solution hasn't been updated in a couple months? Does it actually work well enough for you, or was this just an experiment?

@robianmcd
Copy link
Owner

I am actively working on this project https://github.com/robianmcd/open-dvs. The build for it is based on hello-angular-rollup and it has been working out pretty well for me. I am trying to remember to reflect any changes I make to the build in both projects. The builds have gotten a little bit different on the two projects because I have some unit tests on open-dvs and did a bit of refactoring but nothing major. If I was personally starting a new project I would use this repo. It is not documented though so if you try using it let me know if you have any questions.

@mfreeman-xtivia
Copy link
Author

mfreeman-xtivia commented Mar 14, 2017 via email

@robianmcd
Copy link
Owner

The problem with keeping the bundles separate is that you can't take advantage of rollup's tree shaking. e.g. in the dev build for this repo the vendor bundle contains everything from the vendor files but in the production build, rollup removes any unnecessary vendor code.

There is an open issue on rollup to add support for splitting code into multiple bundles after tree shaking happens rollup/rollup#372. But I'm not sure if any progress has been made on it. If you are ok when the vendor bundle containing some unnecessary code and the file size being bigger then I don't see any other issues with keeping it separate in production.

@mfreeman-xtivia
Copy link
Author

mfreeman-xtivia commented Mar 16, 2017 via email

@robianmcd
Copy link
Owner

hmmm not sure why. As far as I know compiling your app with ngc shouldn't affect the vendor code at all.

@mfreeman-xtivia
Copy link
Author

mfreeman-xtivia commented Mar 19, 2017 via email

@robianmcd
Copy link
Owner

yeah that looks problematic. I did some googling but can't find anything on weather there is a way to avoid those generated imports of angular source files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants