angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Deal with a lot of components and big main.bundle.js file size

Open haku-d opened this issue 9 years ago • 3 comments

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Versions.

@angular/cli: 1.3.2 node: 8.4.0 os: linux x64 @angular/animations: 4.3.6 @angular/common: 4.3.6 @angular/compiler: 4.3.6 @angular/core: 4.3.6 @angular/forms: 4.3.6 @angular/http: 4.3.6 @angular/platform-browser: 4.3.6 @angular/platform-browser-dynamic: 4.3.6 @angular/router: 4.3.6 @angular/cli: 1.3.2 @angular/compiler-cli: 4.3.6 @angular/language-service: 4.3.6

Repro steps.

I have dealed with large application with a lot of components. Each component has included it's style. When I try to run ng build with --prod mode, It's seem all components style was packed in main.bundle.js

Below is my ng build --prod command result with big size of main.bundle.js file

chunk {0} 0.164d8b2a4aec0c9e049a.chunk.js () 19.3 kB {18} [rendered] chunk {1} 1.815a195fa3db3d6ae17a.chunk.js () 2.07 kB {18} [rendered] chunk {2} 2.fb8feb1a448bff58d783.chunk.js () 3.22 kB {18} [rendered] chunk {3} 3.b8a2a114630655637d70.chunk.js () 11.4 kB {18} [rendered] chunk {4} 4.45ed2678ac21e099d72b.chunk.js () 1.56 kB {18} [rendered] chunk {5} 5.caa27cbe5ebac784bb7e.chunk.js () 1.63 kB {18} [rendered] chunk {6} 6.36ca15b7a1099dbdd7ea.chunk.js () 1.47 kB {18} [rendered] chunk {7} 7.ce2b1acfaed0cb6f935a.chunk.js () 4.38 kB {18} [rendered] chunk {8} 8.5f9e699f909b43aa9dc1.chunk.js () 3.23 kB {18} [rendered] chunk {9} 9.4b10bdb5a471b52b750a.chunk.js () 2.21 kB {18} [rendered] chunk {10} 10.5262c75cdddc7d12bcaf.chunk.js () 2.65 kB {18} [rendered] chunk {11} 11.5d4ab1fb5fdf689502f6.chunk.js () 1.54 kB {18} [rendered] chunk {12} 12.87d6893ef4817bd2ea68.chunk.js () 1.47 kB {18} [rendered] chunk {13} 13.2c99a3c5fa230d023606.chunk.js () 1.47 kB {18} [rendered] chunk {14} 14.33369e384bfe2b2d06fe.chunk.js () 1.47 kB {18} [rendered] chunk {15} 15.1f668a818c5c22fb230e.chunk.js () 5.27 kB {18} [rendered] chunk {16} 16.2afbf5c4f9670c64c86f.chunk.js () 1.72 kB {18} [rendered] chunk {17} 17.e155aba484f07f37b53c.chunk.js () 3.42 kB {18} [rendered] chunk {18} main.e126ac1027376d101cfd.bundle.js (main) 5.16 MB {22} [initial] [rendered] chunk {19} polyfills.29b2a879fd738801c907.bundle.js (polyfills) 93.3 kB {23} [initial] [rendered] chunk {20} scripts.6b598e05f9de542020a8.bundle.js (scripts) 502 kB {23} [initial] [rendered] chunk {21} styles.4290965164238bcb946b.bundle.css (styles) 457 kB {23} [initial] [rendered] chunk {22} vendor.dfb2e253206fb866d0dd.bundle.js (vendor) 421 kB [initial] [rendered] chunk {23} inline.2e307a52513699e71005.bundle.js (inline) 1.94 kB [entry] [rendered]

Feature request

How can I extract all component styles into single style.bundle.css and how optimized or compress this bundle ?

haku-d avatar Aug 27 '17 07:08 haku-d

Hi there,

Can you provide a reproduction we can follow of this happening please?

filipesilva avatar Sep 04 '17 14:09 filipesilva

Closing as no reproduction was provided

alan-agius4 avatar Sep 03 '18 06:09 alan-agius4

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.