I am interested in Angular-cli structure. When I build prod, (ng build -prod) I got folder dist where I found same files, just one of them is gzip, another is not.
Structure folder /dist
:
Do I need gzip files or not? or maybe instead of gzip I do not need just JS files. Why do I have to hold two copies of the files?.
My folder gets more weight because of that. Could you explain to me how this works?
Update
Gzip generation has been removed the Angular CLI because it was confusing to many people, and now the CLI only outputs the files you actually use.
For more information, check out the official
ng build
documentation.
The gz
files exist so you can check the real size the js
files will have when sent to the browser. Because you are almost definitely going to use GZIP on the server.
You can skip generating them by adding --suppress-sizes true
.
That will remove most of them. There's a bug that makes it leave one gz
still, which you can still workaround by adding --vendor-chunk false
.
You can see more optimizations and get the context from my comment on this issue in the Angular CLI repository.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With