File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1313 "test" : " ./node_modules/.bin/mocha tests/helpers/setup.js tests/**/*.spec.js --require @babel/register" ,
1414 "test:watch" : " npm test -- --watch" ,
1515 "test:coverage" : " nyc npm test" ,
16- "build" : " ./node_modules/.bin/webpack --config webpack.config.prod.js -p"
16+ "build" : " ./node_modules/.bin/webpack --config webpack.config.prod.js -p" ,
17+ "analyze" : " BUNDLE_ANALYZE=true ./node_modules/.bin/webpack --config webpack.config.prod.js -p"
1718 },
1819 "files" : [
1920 " dist"
9899 "react" : " ^16.3.0" ,
99100 "react-dom" : " ^16.3.0"
100101 }
101- }
102+ }
Original file line number Diff line number Diff line change 11const path = require ( 'path' ) ;
22const CleanWebpackPlugin = require ( 'clean-webpack-plugin' ) ;
33const UglifyJsPlugin = require ( 'uglifyjs-webpack-plugin' ) ;
4- // const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
4+ const BundleAnalyzerPlugin = require ( 'webpack-bundle-analyzer' ) . BundleAnalyzerPlugin ;
55
66module . exports = {
77 mode : 'production' ,
@@ -26,7 +26,7 @@ module.exports = {
2626 new UglifyJsPlugin ( {
2727 comments : false ,
2828 } ) ,
29- // new BundleAnalyzerPlugin(),
29+ process . env . BUNDLE_ANALYZE === 'true' ? new BundleAnalyzerPlugin ( ) : ( ) => { }
3030 ] ,
3131 module : {
3232 rules : [
You can’t perform that action at this time.
0 commit comments