Skip to content

Commit

Permalink
add css optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
crabbly committed Aug 19, 2018
1 parent 6132d22 commit 57d0c35
Show file tree
Hide file tree
Showing 3 changed files with 729 additions and 15 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"css-loader": "^1.0.0",
"mini-css-extract-plugin": "^0.4.1",
"node-sass": "^4.9.3",
"optimize-css-assets-webpack-plugin": "^5.0.0",
"sass-loader": "^7.1.0",
"standard": "^7.1.2",
"uglifyjs-webpack-plugin": "^1.3.0",
Expand Down
17 changes: 13 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')

module.exports = {
entry: [
Expand Down Expand Up @@ -48,9 +49,17 @@ module.exports = {
plugins: [
new MiniCssExtractPlugin({
filename: 'print.min.css'
}),
new UglifyJSPlugin({
sourceMap: true
})
]
],
optimization: {
minimizer: [
new OptimizeCssAssetsPlugin({
assetNameRegExp: /\.css$/g,
canPrint: false
}),
new UglifyJSPlugin({
sourceMap: true
})
]
}
}
Loading

0 comments on commit 57d0c35

Please sign in to comment.