diff --git a/packages/angular-cli/models/webpack-build-common.ts b/packages/angular-cli/models/webpack-build-common.ts index 6d1bbe01c76f..78efa3b2e534 100644 --- a/packages/angular-cli/models/webpack-build-common.ts +++ b/packages/angular-cli/models/webpack-build-common.ts @@ -4,8 +4,6 @@ import {GlobCopyWebpackPlugin} from '../plugins/glob-copy-webpack-plugin'; import {BaseHrefWebpackPlugin} from '@angular-cli/base-href-webpack'; const HtmlWebpackPlugin = require('html-webpack-plugin'); -const autoprefixer = require('autoprefixer'); - export function getWebpackCommonConfig( projectRoot: string, @@ -116,7 +114,9 @@ export function getWebpackCommonConfig( new webpack.LoaderOptionsPlugin({ test: /\.(css|scss|sass|less|styl)$/, options: { - postcss: [ autoprefixer() ] + postcss: [ + require('autoprefixer') + ] }, }), ], diff --git a/packages/angular-cli/models/webpack-build-production.ts b/packages/angular-cli/models/webpack-build-production.ts index e925035a7395..1846db2bfe5c 100644 --- a/packages/angular-cli/models/webpack-build-production.ts +++ b/packages/angular-cli/models/webpack-build-production.ts @@ -69,8 +69,10 @@ export const getWebpackProdConfigPartial = function(projectRoot: string, appConf minRatio: 0.8 }), new webpack.LoaderOptionsPlugin({ + test: /\.(css|scss|sass|less|styl)$/, options: { postcss: [ + require('autoprefixer'), require('postcss-discard-comments') ] }