@@ -12,9 +12,10 @@ module.exports = function (env = {}) {
12
12
let outputFilename
13
13
let plugins = [ ]
14
14
let moduleRules = [ ]
15
+ let cssModulesScopedName = '[path]___[name]__[local]___[hash:base64:5]'
15
16
16
17
////////////////////////////////////// output.filename
17
- outputFilename = env . production ? 'static/js/bundle.[hash ].js' : 'static/js/[name].js'
18
+ outputFilename = env . production ? 'static/js/bundle.[chunkhash ].js' : 'static/js/[name].js'
18
19
19
20
////////////////////////////////////// plugins
20
21
plugins . push (
@@ -30,7 +31,7 @@ module.exports = function (env = {}) {
30
31
new CompressionWebpackPlugin ( {
31
32
test : / \. j s $ /
32
33
} ) ,
33
- new ExtractTextPlugin ( 'static/css/bundle.[hash ].css' )
34
+ new ExtractTextPlugin ( 'static/css/bundle.[chunkhash ].css' )
34
35
)
35
36
} else {
36
37
// development
@@ -57,7 +58,7 @@ module.exports = function (env = {}) {
57
58
[ ] ,
58
59
plugins : [
59
60
'transform-react-jsx' ,
60
- 'react-css-modules' ,
61
+ [ 'react-css-modules' , { generateScopedName : cssModulesScopedName } ] ,
61
62
]
62
63
}
63
64
} ,
@@ -77,7 +78,7 @@ module.exports = function (env = {}) {
77
78
modules : true ,
78
79
importLoaders : 1 ,
79
80
sourceMap : true ,
80
- localIdentName : '[path]___[name]__[local]___[hash:base64:5]' ,
81
+ localIdentName : cssModulesScopedName ,
81
82
}
82
83
} ,
83
84
'postcss-loader' ,
@@ -91,7 +92,7 @@ module.exports = function (env = {}) {
91
92
modules : true ,
92
93
importLoaders : 1 ,
93
94
sourceMap : true ,
94
- localIdentName : '[path]___[name]__[local]___[hash:base64:5]' ,
95
+ localIdentName : cssModulesScopedName ,
95
96
}
96
97
} ,
97
98
'postcss-loader' ,
@@ -101,7 +102,7 @@ module.exports = function (env = {}) {
101
102
102
103
103
104
return {
104
- performance : false ,
105
+ context ,
105
106
entry : env . production ?
106
107
// production
107
108
[ './config/polyfills.ts' , './src/index.ts' ] :
@@ -124,6 +125,7 @@ module.exports = function (env = {}) {
124
125
} ,
125
126
plugins,
126
127
devtool : 'source-map' ,
128
+ performance : false ,
127
129
}
128
130
129
131
}
0 commit comments