-
Notifications
You must be signed in to change notification settings - Fork 12k
vendor.bundle.js size is around 10 MB #9016
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
Comments
What command did you run to get these results?
Try If that is still large, then do a run through in your application for third-party libraries that you are using. (1) Are you importing the entire RxJS library? (2) Moment with all localizations? etc.. |
With the latest CLI, |
Thanks for the detailed explanation @jgodi and @clydin, Thanks. I tried to run the command as mentioned but getting below error. Although the size of the bundles are too low as expected, Im trying to figure out this issue. I hope you are aware of this issue related to ngfactory. Your help in resolving this issue will be most appreciated. Thanks. |
@filipesilva @jgodi @clydin My main.ts looks as below: import { enableProdMode } from '@angular/core'; import { AppModule } from './app/app.module'; if (environment.production) { platformBrowserDynamic().bootstrapModule(AppModule) |
jgodi saved my day!!!!!!!!!!!!!!!! What a solution.. Thanks man. It worked. It got my site content from 11BMB to 1MB.. Plus using lazy loaded modules makes load faster |
I got the same issue using Angular CLI |
@danielmhair The size of the rectangle represents the percentage of the total size within the bundle. Both |
I understand that. And your right that the parsed size is smaller. I forgot to mention that. Thanks for reminding me, but its still about 1 MB. Prior to Angular 6, our entire size came to 1.5 MB. That included all of these packages (@progress, faker, @angular and everything else). I understand that faker is large and I'm working on getting that smaller, but I was focusing on @angular for this issue. It was claimed that with AOT compiling, @angular would be 250kb. I understand that I am using @angular/material and that wouldn't be considered in that size. But that means without @angular/material, the parsed size is ~600kb. That is a lot more than 250kb. We do use lazy loading, but due to the Angular 6 update, there is a bug that is forcing us out of lazy loading, but that is another issue we are working to resolve. But here is my main purpose: I'm messaging in here to figure out how to lower the size to where it was before the update to Angular 6. That's a much bigger size that it was before. All we did was update packages like rxjs and the main packages that required us to update to their Angular 6 version. Now writing this out though, I think your right, in that perhaps its @progress and faker that I need to worry about the most. I did have to update @progress to their Angular 6 package, so maybe their package increased by then. Thanks for your info. |
The gzipped size (which represents the actual client transfer size) is less then 250kb. This is with material, cdk, animations, and forms (which together appears to be two thirds of that size). Also important to note is that the new renderer currently under development will reduce sizes even further. Some areas that should be investigated is the inclusion of locales within |
Yeah, for sure. Thanks for your thoughts @clydin. I'm planning to remove the locales from |
Actually, sorry, I think your referring to |
oh sorry. yes. It looked like it was inside of the Only code using ES2015 modules (can be ES5 with ES2015 modules) can be tree-shaken. |
It works for me
chunk {main} main.js, main.js.map (main) 1.27 MB [initial] [rendered]
chunk {0} runtime.a66f828dca56eeb90e02.js (runtime) 1.05 kB [entry] [rendered] And without .js.map |
@AdrianGrabowski thanks, Its work for me !! |
not working for me |
@AdrianGrabowski works perfectly!! <3 |
Hi , Can we reduce or zip Scripts bundle file |
utilize children nas suas rotas, refaça toda estrutura usando isso, irá resolver, o seu vendor.js está grande devido a quantidade de rotas iniciais que são carregadas. |
I already use child routes very everything. I got vendor.js down from 15mb to 3.8 |
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. |
ng -v 1.5.4
node -v 6.11.2
npm -v 3.10.10
Observed behavior
We have an application with more than 7 modules. When we build this application we are getting vendor.bundle.js file of size 9.95 MB. This will have an impact on performance. Can someone explain the reason fro this and how to reduce the size of build files.
Desired behavior
Expecting lesser size for bundle files
The text was updated successfully, but these errors were encountered: