File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 3939 "locks" : " ^0.2.2" ,
4040 "mini-css-extract-plugin" : " ^0.4.1" ,
4141 "node-sass" : " ^4.9.3" ,
42+ "optimize-css-assets-webpack-plugin" : " ^5.0.1" ,
4243 "prop-types" : " ^15.6.2" ,
4344 "react" : " ^16.4.2" ,
4445 "react-dom" : " ^16.4.2" ,
Original file line number Diff line number Diff line change 11const path = require ( 'path' ) ;
22const MiniCssExtractPlugin = require ( "mini-css-extract-plugin" ) ;
3-
3+ var OptimizeCssAssetsPlugin = require ( 'optimize-css-assets-webpack-plugin' ) ;
44/**
55 * TODO remove when webpack fixed this error:
66 * Links to this error:
@@ -61,6 +61,7 @@ module.exports = (env, argv) => {
6161 loader : "css-loader" ,
6262 options : {
6363 "sourceMap" : ! isProduction ,
64+ "minimize" : isProduction
6465 }
6566 } ,
6667 "resolve-url-loader" ,
@@ -124,7 +125,13 @@ module.exports = (env, argv) => {
124125 new FixStyleOnlyEntriesPlugin ( ) ,
125126 new MiniCssExtractPlugin ( {
126127 filename : "[name].css"
127- } )
128+ } ) ,
129+ ( isProduction ) ?
130+ new OptimizeCssAssetsPlugin ( {
131+ cssProcessorPluginOptions : {
132+ preset : [ 'default' , { discardComments : { removeAll : true } } ] ,
133+ } ,
134+ } ) : ( ) => { }
128135 ]
129136 }
130137}
You can’t perform that action at this time.
0 commit comments