Skip to content

Instantly share code, notes, and snippets.

@hiyali
Created August 6, 2016 04:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiyali/267c7fbdcb59e301917cdc90b438dba8 to your computer and use it in GitHub Desktop.
Save hiyali/267c7fbdcb59e301917cdc90b438dba8 to your computer and use it in GitHub Desktop.
1. size analys
npm i -g webpack-bundle-size-analyzer
webpack --json | webpack-bundle-size-analyzer
2. webpack.config.js for minimize
new webpack.optimize.UglifyJsPlugin({
minimize: true,
compress: {
warnings: false,
},
}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.LimitChunkCountPlugin({maxChunks: 15}),
new webpack.optimize.MinChunkSizePlugin({minChunkSize: 10000}),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.DefinePlugin({
'__DEVTOOLS': false,
'process.env': {NODE_ENV: '"production"'}
}), //**/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment