preact-boilerplate icon indicating copy to clipboard operation
preact-boilerplate copied to clipboard

Optimize Bundle Size further by Gzipping

Open unicodeveloper opened this issue 7 years ago • 2 comments

Right now, when you run npm run build, it only minifies and bundles the files. In my current app, I get this:

screen shot 2017-06-01 at 11 39 38 pm

With this PR, you can now optimize your app bundle further by gzipping the files. Now your app bundle size will reduce greatly just like mine did like so:

screen shot 2017-06-02 at 12 27 47 am

bundle.js.gz - 39.3kb

Whoop! Whoop!

@developit please review!

unicodeveloper avatar Jun 01 '17 23:06 unicodeveloper

@developit Please check this PR out!

unicodeveloper avatar Jun 06 '17 13:06 unicodeveloper

@unicodeveloper This looks great. I have a question on something that looks important but I haven't explored myself. I was looking at documentation and since you are bringing this up, should we see if deleteOriginalAssets flag would make sense. I'm thinking once assets are used to create new gz ones, would it make sense to delete older files. I haven't tried this plugin before, any thoughts? I'm not sure which pick would be better, true or false.

Also consider this as a ⚔️ conflict alert.

crashuniverse avatar Jul 04 '17 18:07 crashuniverse