Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

support webpack config for minification #186

Closed
hongbo-miao opened this issue Oct 2, 2016 · 7 comments
Closed

support webpack config for minification #186

hongbo-miao opened this issue Oct 2, 2016 · 7 comments

Comments

@hongbo-miao
Copy link
Contributor

hongbo-miao commented Oct 2, 2016

Please add webpack config options for minification, thanks!

Right now the browser loads a 3.4MB index.js file:

image

@hongbo-miao hongbo-miao changed the title add webpack config for minification support webpack config for minification Oct 2, 2016
@mekya
Copy link

mekya commented Oct 3, 2016

you can try to run

npm run build:prod

It reduces index.js size to about 1MB

Welcome for better recommendations...

@TomerCohavi
Copy link

@mekya Any idea on how to reduce even more the bundle size? 1MB is super heavy especially on mobile.

@kuldeepkeshwar
Copy link
Contributor

@TomerCohavi use code splitting (lazy-routes) and AOT

@mekya
Copy link

mekya commented Oct 18, 2016

@TomerCohavi
one more addition: gzip, take a look at this blog post
http://blog.mgechev.com/2016/06/26/tree-shaking-angular2-production-build-rollup-javascript/

@TomerCohavi
Copy link

@kuldeepkeshwar Thanks!
@mekya I've managed to reduce it to ~350kb with gzip. Thanks!

@hongbo-miao
Copy link
Contributor Author

hongbo-miao commented Oct 18, 2016

Thanks @mekya, I made a PR here for gzip.

For lazy load, track #175
For AOT, track #197

@PatrickJS
Copy link
Member

there is a prod build now

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

No branches or pull requests

5 participants