-
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
main bundle size in MBs #2281
Comments
Found out that the main.bundle.js is not minified. I run my own minification script and managed to reduce main.bundle.js from 3MB to 0.9MB. I guess until the team add minification into ng build, you could just do it yourself for the time being. |
did you run |
Could this be a case of docs-could-be-better? The README says "...using the --prod flag in ng build --prod or ng serve --prod will also make use of uglifying and tree-shaking functionality", which is true and good. Maybe it should also use the more general word "minification" in addition to (or instead of) the specific "uglifying"? That way someone searching the docs for "minifi" would find it. |
The main.bundle.js is minified indeed in prod mode. I understand the AOT is still not supported in CLI, But what else I could do here to reduce the bundle size. |
@filipesilva Do you have any idea here? |
Same story for me, the hello world is: Could someone enlighten us about why it's so big for an "empty" project ? |
And if you put some code in with some plugins like material the bundle size gets about 5mb in dev and 400kb gzipped. Looking forward for aot |
208 is the browser retrieving from cache. Gzipped for hello world is probably around 150kb |
@deebloo mine is not an hello world. would check the size. |
@a5hik I am just saying double check your bundle size. It isn't possible that the bundle is 208B. |
@deebloo Thanks!. sorry I didn't realise the K is missing from it. Now it comes around 600KB of size, I can see that in the browser console. after clearing the Cache. Still its a large size. |
to the rescue |
Is this possible to do with beta.16? |
I had updated to beta.16
And running
I guess calling the XXXModule.forRoot() is causing the problem in module Imports. |
Seems to not support animation
|
Sorry, but there isn't much I can do to help you on this issue. I don't see an actionable CLI problem here. It's true that |
Where did you add compress=true? @a5hik |
@emaradevska, in webpack it looks something like this:
|
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. |
angular-cli: 1.0.0-beta.14 node: 6.2.1 os: darwin x64
I noticed that my app generates the main bundle in MBs .. here is my
package.json
dependencies entries."dependencies": { "@angular/common": "2.0.0", "@angular/compiler": "2.0.0", "@angular/core": "2.0.0", "@angular/forms": "2.0.0", "@angular/http": "2.0.0", "@angular/platform-browser": "2.0.0", "@angular/platform-browser-dynamic": "2.0.0", "@angular/router": "3.0.0", "@angular2-material/button": "^2.0.0-alpha.8-1", "@angular2-material/button-toggle": "^2.0.0-alpha.8-1", "@angular2-material/card": "^2.0.0-alpha.8-1", "@angular2-material/checkbox": "^2.0.0-alpha.8-1", "@angular2-material/core": "^2.0.0-alpha.8-1", "@angular2-material/grid-list": "^2.0.0-alpha.8-1", "@angular2-material/icon": "^2.0.0-alpha.8-1", "@angular2-material/input": "^2.0.0-alpha.8-1", "@angular2-material/list": "^2.0.0-alpha.8-1", "@angular2-material/menu": "^2.0.0-alpha.8-1", "@angular2-material/progress-bar": "^2.0.0-alpha.8-1", "@angular2-material/progress-circle": "^2.0.0-alpha.8-1", "@angular2-material/radio": "^2.0.0-alpha.8-1", "@angular2-material/sidenav": "^2.0.0-alpha.8-1", "@angular2-material/slide-toggle": "^2.0.0-alpha.8-1", "@angular2-material/slider": "^2.0.0-alpha.8-1", "@angular2-material/tabs": "^2.0.0-alpha.8-1", "@angular2-material/toolbar": "^2.0.0-alpha.8-1", "@angular2-material/tooltip": "^2.0.0-alpha.8-1", "bootstrap": "^4.0.0-alpha.2", "c3": "^0.4.11", "clipboard": "^1.5.12", "core-js": "^2.4.1", "font-awesome": "^4.6.3", "hammerjs": "^2.0.8", "hover.css": "^2.0.2", "lodash": "^4.15.0", "ng2-accordion": "0.0.9", "ng2-bootstrap": "1.1.5", "ng2-file-upload": "^1.0.3", "ng2-slim-loading-bar": "^1.5.1", "randomcolor": "^0.4.4", "reflect-metadata": "0.1.3", "rxjs": "5.0.0-beta.12", "simplemde": "^1.11.2", "sortablejs": "^1.4.2", "ts-helpers": "^1.1.1", "zone.js": "^0.6.23" }
The main.bundle.js size is 2.5 MB in Prod mode and it was 6.7 MB in Dev mode. I feel its huge and any clues to reduce the size would be much appreciated.
The text was updated successfully, but these errors were encountered: