File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4848 "chalk" : " ^1.1.3" ,
4949 "common-tags" : " ^1.3.1" ,
5050 "css-loader" : " ^0.26.1" ,
51+ "cssnano" : " ^3.10.0" ,
5152 "debug" : " ^2.1.3" ,
5253 "denodeify" : " ^1.2.1" ,
5354 "diff" : " ^2.2.2" ,
8182 "opn" : " 4.0.1" ,
8283 "ora" : " ^0.2.0" ,
8384 "portfinder" : " 1.0.9" ,
84- "postcss-discard-comments" : " ^2.0.4" ,
8585 "postcss-loader" : " ^0.9.1" ,
8686 "raw-loader" : " ^0.5.1" ,
8787 "reflect-metadata" : " ^0.1.8" ,
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ export const getProdConfig = function (wco: WebpackConfigOptions) {
1313 new webpack . DefinePlugin ( {
1414 'process.env.NODE_ENV' : JSON . stringify ( 'production' )
1515 } ) ,
16- new webpack . LoaderOptionsPlugin ( { minimize : true } ) ,
1716 new webpack . optimize . UglifyJsPlugin ( < any > {
1817 mangle : { screw_ie8 : true } ,
1918 compress : { screw_ie8 : true , warnings : buildOptions . verbose } ,
Original file line number Diff line number Diff line change 66import { extraEntryParser , getOutputHashFormat } from './utils' ;
77import { WebpackConfigOptions } from '../webpack-config' ;
88
9- const postcssDiscardComments = require ( 'postcss-discard-comments ' ) ;
9+ const cssnano = require ( 'cssnano ' ) ;
1010const autoprefixer = require ( 'autoprefixer' ) ;
1111const ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
1212
@@ -38,9 +38,10 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
3838 // https://github.com/webpack-contrib/style-loader#recommended-configuration
3939 const cssSourceMap = buildOptions . extractCss && buildOptions . sourcemap ;
4040
41- // discard comments in production
41+ // minify/optimize css in production
42+ // autoprefixer is always run separately so disable here
4243 const extraPostCssPlugins = buildOptions . target === 'production'
43- ? [ postcssDiscardComments ]
44+ ? [ cssnano ( { safe : true , autoprefixer : false } ) ]
4445 : [ ] ;
4546
4647 // determine hashing format
Original file line number Diff line number Diff line change 3838 "chalk" : " ^1.1.3" ,
3939 "common-tags" : " ^1.3.1" ,
4040 "css-loader" : " ^0.26.1" ,
41+ "cssnano" : " ^3.10.0" ,
4142 "debug" : " ^2.1.3" ,
4243 "denodeify" : " ^1.2.1" ,
4344 "diff" : " ^2.2.2" ,
6869 "opn" : " 4.0.1" ,
6970 "ora" : " ^0.2.0" ,
7071 "portfinder" : " 1.0.9" ,
71- "postcss-discard-comments" : " ^2.0.4" ,
7272 "postcss-loader" : " ^0.9.1" ,
7373 "raw-loader" : " ^0.5.1" ,
7474 "remap-istanbul" : " ^0.6.4" ,
You can’t perform that action at this time.
0 commit comments