@@ -19,8 +19,10 @@ for (const path of glob('web_src/less/themes/*.less')) {
19
19
themes [ parse ( path ) . name ] = [ path ] ;
20
20
}
21
21
22
+ const isProduction = process . env . NODE_ENV !== 'development' ;
23
+
22
24
module . exports = {
23
- mode : 'production' ,
25
+ mode : isProduction ? 'production' : 'development ',
24
26
entry : {
25
27
index : [
26
28
resolve ( __dirname , 'web_src/js/index.js' ) ,
@@ -42,7 +44,7 @@ module.exports = {
42
44
chunkFilename : 'js/[name].js' ,
43
45
} ,
44
46
optimization : {
45
- minimize : true ,
47
+ minimize : isProduction ,
46
48
minimizer : [
47
49
new TerserPlugin ( {
48
50
sourceMap : true ,
@@ -96,6 +98,7 @@ module.exports = {
96
98
resolve ( __dirname , 'package-lock.json' ) ,
97
99
resolve ( __dirname , 'webpack.config.js' ) ,
98
100
] . map ( ( path ) => statSync ( path ) . mtime . getTime ( ) ) . join ( ':' ) ,
101
+ sourceMaps : true ,
99
102
presets : [
100
103
[
101
104
'@babel/preset-env' ,
@@ -190,6 +193,7 @@ module.exports = {
190
193
} ) ,
191
194
] ,
192
195
performance : {
196
+ hints : isProduction ? 'warning' : false ,
193
197
maxEntrypointSize : 512000 ,
194
198
maxAssetSize : 512000 ,
195
199
assetFilter : ( filename ) => {
@@ -201,4 +205,9 @@ module.exports = {
201
205
resolve : {
202
206
symlinks : false ,
203
207
} ,
208
+ watchOptions : {
209
+ ignored : [
210
+ 'node_modules/**' ,
211
+ ] ,
212
+ } ,
204
213
} ;
0 commit comments