timarney/react-setup

UglifyJS?

kentcdodds opened this issue · 3 comments

I haven't pulled it down, but since you're asking for feedback, I don't see you using the UglifyJSPlugin. That should shrink things considerably.

Not sure if I set it up correctly but just added

 plugins: [
    new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js'),
    new webpack.optimize.UglifyJsPlugin( {compress: {
        warnings: false
    }}),
  ]

and did a build. Still sitting at 190kb.

Ah, yeah, didn't notice that you're running webpack with the -p flag which will basically do this (just without the options).

I still recommend using the UglifyJsPlugin because it allows you to configure it (like ignoring warnings which can be reeeeally noisy).

I tried adding

new webpack.optimize.OccurenceOrderPlugin(true),
new webpack.optimize.DedupePlugin(),

as well.

Shaved off 1 KB

With the -p flag turned on does that superceed any plugins that are added or is the opposite true?

Maybe some material for your @egghead videos ;)