@@ -28,7 +28,8 @@ const configure = ({name, vueVersion}) => (env = {}, { mode = 'production', conf
28
28
const {
29
29
targetsBrowsers = 'defaults' ,
30
30
noPresetEnv = ! isProd ,
31
- noCompress = ! isProd
31
+ noCompress = ! isProd ,
32
+ noSourceMap = ! isProd ,
32
33
} = env ;
33
34
34
35
const genSourcemap = false ;
@@ -61,7 +62,7 @@ const configure = ({name, vueVersion}) => (env = {}, { mode = 'production', conf
61
62
} ,
62
63
63
64
// doc: https://webpack.js.org/configuration/devtool/#devtool
64
- devtool : isProd ? 'source-map' : 'cheap-source-map' ,
65
+ devtool : noSourceMap ? false : isProd ? 'source-map' : 'cheap-source-map' ,
65
66
66
67
performance : { hints : false } ,
67
68
@@ -128,22 +129,25 @@ const configure = ({name, vueVersion}) => (env = {}, { mode = 'production', conf
128
129
] : [ ] ,
129
130
130
131
...isProd ? [
131
- new CompressionPlugin ( {
132
- filename : "[path][base].br" ,
133
- algorithm : "brotliCompress" ,
134
- compressionOptions : {
135
- params : {
136
- [ zlib . constants . BROTLI_PARAM_QUALITY ] : zlib . constants . BROTLI_MAX_QUALITY ,
132
+
133
+ ...! noCompress ? [
134
+ new CompressionPlugin ( {
135
+ filename : "[path][base].br" ,
136
+ algorithm : "brotliCompress" ,
137
+ compressionOptions : {
138
+ params : {
139
+ [ zlib . constants . BROTLI_PARAM_QUALITY ] : zlib . constants . BROTLI_MAX_QUALITY ,
140
+ } ,
137
141
} ,
138
- } ,
139
- } ) ,
140
- new CompressionPlugin ( {
141
- filename : "[path][base].gz " ,
142
- algorithm : "gzip" ,
143
- compressionOptions : {
144
- level : 9 ,
145
- } ,
146
- } ) ,
142
+ } ) ,
143
+ new CompressionPlugin ( {
144
+ filename : "[path][base].gz" ,
145
+ algorithm : "gzip " ,
146
+ compressionOptions : {
147
+ level : 9 ,
148
+ } ,
149
+ } ) ,
150
+ ] : [ ] ,
147
151
new DuplicatePackageCheckerPlugin ( ) ,
148
152
new BundleAnalyzerPlugin ( {
149
153
// doc: https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin
0 commit comments