Quellcode durchsuchen

开心灵工腾讯验证码

wangxin vor 5 Jahren
Ursprung
Commit
c4e96f2ac8
1 geänderte Dateien mit 9 neuen und 7 gelöschten Zeilen
  1. 9 7
      vue.config.js

+ 9 - 7
vue.config.js

@@ -11,13 +11,15 @@ module.exports = {
     outputDir: 'dist',
     publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
     configureWebpack: config => {
-        config.plugins.push(
-            new CompressionWebpackPlugin({
-                test: /\.js$|\.html$|\.css$/,
-                // 超过4kb压缩
-                threshold: 4096
-            })
-        )
+        if (process.env.NODE_ENV === 'production') {
+            config.plugins.push(
+                new CompressionWebpackPlugin({
+                    test: /\.js$|\.html$|\.css$/,
+                    // 超过4kb压缩
+                    threshold: 4096
+                })
+            )
+        }
     },
     chainWebpack: (config) => {
         config.resolve.alias