John williams
John williams

Reputation: 731

If it possible to compress angular2 Js bundle files further

Does anyone have any idea on additional ways to compress the generated production Angular Js files?

Here is what am currently doing...

  1. ng build --prod
  2. grunt
    • concat all files in order of output
    • uglify concatenated js file

I have managed to get it down to around 1.2mb from the above but I would ideally get it down to under a meg.

Upvotes: 0

Views: 418

Answers (1)

LoïcR
LoïcR

Reputation: 5039

Another way to improve your compression could be to build using the AOT flag (--aot) which will again, reduce the size of your bundle.

Also, don't forget that the file will be compressed with gzip by your server and will, in the end, weight not as much as 300ko, which is something pretty decent for your whole application. :)

Upvotes: 1

Related Questions