Skip to content

Commit

Permalink
优化css体积
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri authored and yuri committed Mar 13, 2018
1 parent b627a68 commit 25df2e3
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions build/webpack.package.prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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: [
Expand All @@ -35,6 +26,9 @@ module.exports = merge(baseWebpackConfig, {
warnings: false
}
}),
extractLESS
extractLESS,
new OptimizeCssAssetsPlugin({
cssProcessorOptions: { safe: true }
}),
]
})

0 comments on commit 25df2e3

Please # to comment.