File tree 3 files changed +322
-9
lines changed
3 files changed +322
-9
lines changed Original file line number Diff line number Diff line change 15
15
"pre-commit" : " ^1.2.2" ,
16
16
"prettier" : " ^1.5.3" ,
17
17
"webpack" : " ^3.5.5" ,
18
+ "webpack-bundle-analyzer" : " ^2.9.1" ,
18
19
"webpack-manifest-plugin" : " ^1.3.1"
19
20
},
20
21
"scripts" : {
25
26
"lint:staged" : " lint-staged"
26
27
},
27
28
"lint-staged" : {
28
- "*.js" : [" prettier --write --single-quote --trailing-comma=es5" , " git add" ]
29
+ "*.js" : [
30
+ " prettier --write --single-quote --trailing-comma=es5" ,
31
+ " git add"
32
+ ]
29
33
},
30
34
"pre-commit" : " lint:staged" ,
31
35
"repository" : {
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ const path = require('path');
2
2
const webpack = require ( 'webpack' ) ;
3
3
const ManifestPlugin = require ( 'webpack-manifest-plugin' ) ;
4
4
const HappyPack = require ( 'happypack' ) ;
5
+ const { BundleAnalyzerPlugin } = require ( 'webpack-bundle-analyzer' ) ;
5
6
6
7
const plugins = [
7
8
new webpack . EnvironmentPlugin ( {
@@ -37,6 +38,10 @@ const plugins = [
37
38
new webpack . NamedModulesPlugin ( ) ,
38
39
] ;
39
40
41
+ if ( process . env . NODE_ENV === 'debug' ) {
42
+ plugins . push ( new BundleAnalyzerPlugin ( ) ) ;
43
+ }
44
+
40
45
if ( process . env . NODE_ENV === 'production' ) {
41
46
plugins . push ( new webpack . optimize . OccurrenceOrderPlugin ( ) ) ;
42
47
plugins . push ( new webpack . optimize . UglifyJsPlugin ( { sourceMap : true } ) ) ;
You can’t perform that action at this time.
0 commit comments