You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dupe of #5272 , This is outside of the scope of cli, you should be configuring the gzip settings in the server which is hosting your files like apache/nginx etc.
@RicardoVaranda@filipesilva
Most webservers (like nginx) are able to serve static files, e.g. if you have a vendor.bundle.js.gz next to your vendor.bundle.js, it'll serve the already compressed .gz file instead of using cpu to compress it again.
Therefore I think it would be great if ng build --prod would create gzipped files directly.
Reacted by Ravinder Payal, Rajesh, Oduntan Oluwatobiloba Stephen, Vladimir Pavlenko, William Grasel, zuosanmu, ooptsd, Todd Werelius, Vasco Correia, Cyril and 42 more
Optional params to generate gzip would be very helpful to don't have to use workarounds.
Reacted by Konstantin Nosov, Nick Partridge, Mahdi Haji Abdolvahab, lucanLepus, Sandor, Lucas Tétreault, Egor, Ahn, Fedor Shchudlo, Edoardo Luppi and 1 more
angular-automatic-lock-bot commented on Sep 9, 2019
Activity
RicardoVaranda commentedon Mar 9, 2017
Dupe of #5272 , This is outside of the scope of cli, you should be configuring the gzip settings in the server which is hosting your files like apache/nginx etc.
filipesilva commentedon Mar 9, 2017
Closing as dupe, thanks @RicardoVaranda!
kaynz commentedon Apr 20, 2017
@RicardoVaranda @filipesilva
Most webservers (like nginx) are able to serve static files, e.g. if you have a vendor.bundle.js.gz next to your vendor.bundle.js, it'll serve the already compressed .gz file instead of using cpu to compress it again.
Therefore I think it would be great if ng build --prod would create gzipped files directly.
vcorr commentedon May 24, 2017
I agree, I understood it did create gz-files at some point, but this functionality was removed?
John0x commentedon Jun 12, 2017
I don't see a reasony, why the cli should not support gzipping. Why has it been removed?
jgodi commentedon Jun 12, 2017
You can see the answer here: #4618 (comment)
drjackson commentedon Jul 12, 2017
I wish there was still at least an option for gzip.
zac1st1k commentedon Aug 3, 2017
in fact,
webpack-dev-serversupports gzip. https://github.com/webpack/webpack-dev-server/tree/master/examples/compression Anguar CLI can pass the parameter down to the server. It is really good for estimating the production performance on a local environment.tan9 commentedon Oct 5, 2018
I ended up using "gzip-all":https://www.npmjs.com/package/gzip-all in my package.json:
{ "...": "...", "scripts": { "...": "...", "build-prod": "ng build --prod && gzip-all \"dist/anti-fraud/*.*\"", "...": "...", }, "...": "...", }rynop commentedon Oct 9, 2018
I think the trend is for SPA to be hosted in a static object store like S3. While a CDN can be put in front to gzip on the fly, IMO it is a waste.
My vote would be to put it back into
ng buildas an optional param, given the number of people that need the use case and the trend mentioned above.For those looking for a workaround:
package.json:
bin/deploy.sh:tdev9 commentedon Jan 21, 2019
Optional params to generate gzip would be very helpful to don't have to use workarounds.
angular-automatic-lock-bot commentedon Sep 9, 2019
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.