Browse Source

perf 设置config

wangcz 7 years ago
parent
commit
a057bce453
1 changed files with 21 additions and 21 deletions
  1. 21 21
      nuxt.config.js

+ 21 - 21
nuxt.config.js

@@ -1,4 +1,4 @@
-// var HtmlWebpackPlugin = require('html-webpack-plugin');
+const HtmlWebpackPlugin = require('html-webpack-plugin');
 const path = require('path')
 const isProdMode = Object.is(process.env.NODE_ENV, 'production')
 const baseUrl = process.env.BASE_URL || (isProdMode ? 'https://sso.ubtob.com/' : 'https://test-sso-server.uuzcc.cn/')
@@ -69,26 +69,26 @@ module.exports = {
         '~plugins': path.join(__dirname, 'plugins'),
         '~store': path.join(__dirname, 'store')
       })
-      // 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,
-      //   }
-      // }
+      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({
       //   title: 'React Title !',
       //   template: './app.html',