Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to enable gzip in an angular cli project

I want to implement compression and then have nginx serve up the compressed files without doing the compression on the fly. I haven't been able to figure out a way to get gzipping into an angular cli project. I was thinking about a separate webpack config and looping over the different bundles but that seemed like it would be introducing unnecessary complexity.

like image 648
Zack Lucky Avatar asked Jul 05 '26 23:07

Zack Lucky


1 Answers

You can use Compression Webpack Plugin. To chane the webpack config inside the Angular CLI, however, you'd have to do ng eject first. Keep in mind that this action is irrevesable.

like image 191
Lazar Ljubenović Avatar answered Jul 08 '26 07:07

Lazar Ljubenović



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!