Browse Source

perf 设置config

wangcz 7 năm trước cách đây
mục cha
commit
393da9bfec
1 tập tin đã thay đổi với 21 bổ sung1 xóa
  1. 21 1
      nuxt.config.js

+ 21 - 1
nuxt.config.js

@@ -69,7 +69,27 @@ module.exports = {
         '~plugins': path.join(__dirname, 'plugins'),
         '~plugins': path.join(__dirname, 'plugins'),
         '~store': path.join(__dirname, 'store')
         '~store': path.join(__dirname, 'store')
       })
       })
-      // console.log( config.plugins)
+      if (config.plugins[4] && config.plugins[4].options && config.plugins[4].options.minify) {
+        config.plugins[4].options.minify = {
+          removeAttributeQuotes: true,
+          collapseWhitespace: true,
+          html5: true,
+          minifyCSS: true,
+          removeComments: true,
+          removeEmptyAttributes: true,
+        }
+      }
+      if (config.plugins[5] && config.plugins[5].options && config.plugins[5].options.minify) {
+        config.plugins[5].options.minify = {
+          removeAttributeQuotes: true,
+          collapseWhitespace: true,
+          html5: true,
+          minifyCSS: true,
+          removeComments: true,
+          removeEmptyAttributes: true,
+        }
+
+      }
       // config.plugins.push(new HtmlWebpackPlugin({
       // config.plugins.push(new HtmlWebpackPlugin({
       //   title: 'React Title !',
       //   title: 'React Title !',
       //   template: './app.html',
       //   template: './app.html',