Skip to content

Commit

Permalink
build: added optimize-css-assets-webpack-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
weyheyhey committed Oct 3, 2018
1 parent 61abbbc commit f059541
Show file tree
Hide file tree
Showing 3 changed files with 633 additions and 19 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"node-sass": "^4.9.3",
"npm-run-all": "^4.1.3",
"open-browser-webpack-plugin": "^0.0.5",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"postcss-flexbugs-fixes": "^4.1.0",
"postcss-loader": "^3.0.0",
"prettier": "^1.14.2",
Expand Down
10 changes: 3 additions & 7 deletions webpack/webpack.client.production.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const ManifestPlugin = require('webpack-manifest-plugin');
Expand Down Expand Up @@ -30,7 +31,8 @@ module.exports = merge(client, {
ascii_only: true
}
}
})
}),
new OptimizeCSSAssetsPlugin({ cssProcessorOptions: { map: { inline: false, annotations: true } } })
]
},
module: {
Expand All @@ -47,8 +49,6 @@ module.exports = merge(client, {
modules: true,
importLoaders: 2,
context: paths.root,
minimize: true,
sourceMap: true,
localIdentName: '[local][hash:base64:5]',
getLocalIdent: createSelectorName
}
Expand All @@ -57,8 +57,6 @@ module.exports = merge(client, {
loader: 'postcss-loader',
options: {
ident: 'postcss',
minimize: true,
sourceMap: true,
plugins: () => [
require('postcss-flexbugs-fixes'),
autoprefixer({
Expand All @@ -76,8 +74,6 @@ module.exports = merge(client, {
{
loader: 'sass-loader',
options: {
minimize: true,
sourceMap: true,
includePaths: [paths.nodeModules, paths.assets]
}
}
Expand Down
Loading

0 comments on commit f059541

Please sign in to comment.