From 25df2e3fabc97080115299f0b7931c09f011fb73 Mon Sep 17 00:00:00 2001 From: yuri Date: Tue, 13 Mar 2018 15:16:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96css=E4=BD=93=E7=A7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/webpack.package.prod.config.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/build/webpack.package.prod.config.js b/build/webpack.package.prod.config.js index b728ae3..2e96f01 100644 --- a/build/webpack.package.prod.config.js +++ b/build/webpack.package.prod.config.js @@ -3,6 +3,7 @@ var merge = require('webpack-merge') var baseWebpackConfig = require('./webpack.package.config') var ExtractTextPlugin = require('extract-text-webpack-plugin') var extractLESS = new ExtractTextPlugin('/style/vue-beauty.min.css') +var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); module.exports = merge(baseWebpackConfig, { output: { @@ -11,17 +12,7 @@ module.exports = merge(baseWebpackConfig, { module: { loaders: [{ test: /\.less$/i, - loader: extractLESS.extract({ - use: [ - { - loader: 'css-loader' , - options: { - minimize: true - } - }, - { loader: 'less-loader' }, - ], - }) + loader: extractLESS.extract(['css-loader','less-loader']) }] }, plugins: [ @@ -35,6 +26,9 @@ module.exports = merge(baseWebpackConfig, { warnings: false } }), - extractLESS + extractLESS, + new OptimizeCssAssetsPlugin({ + cssProcessorOptions: { safe: true } + }), ] }) \ No newline at end of file