Reputation: 3008
Trying to find working example of production build with Angular2. So far I'm using SystemJs for development and I'm ok with it. Would still like to use non-optimized/minimized/bundled files in dev. But for production I'd like to have bundling (with modules, lazy loading and AOT), minification and tree shaking. Can't get it working yet. I don't care if it's webpack or jspm or rollup or anything else as far as it does the job. I got somewhat close with rollup but it doesn't like some packages (ng2-bootstrap) I think because of es5/es2015
Upvotes: 2
Views: 591
Reputation: 5138
I used to use SystemJS + SystemJS Builder and also tried rollup but faced the same issues.
So I've switched to Webpack and have everything working now. Here is my repo: https://github.com/Rebilly/ReDoc
In general:
ngc
before webpack gets in: package.json#L24AOT
I switch between these two files: index.ts#L11I don't use lazy-loading though.
Also, check angular2-webpack-starter.
Upvotes: 1