From 1648d51f6ad99c2885d470cb86eb0f91ef645be7 Mon Sep 17 00:00:00 2001 From: Kristofer Karlsson Date: Wed, 16 Nov 2016 20:23:38 +0100 Subject: [PATCH] fix(build): added autoprefixer to prod Fix #3156 Close #3164 --- packages/angular-cli/models/webpack-build-common.ts | 6 +++--- packages/angular-cli/models/webpack-build-production.ts | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/angular-cli/models/webpack-build-common.ts b/packages/angular-cli/models/webpack-build-common.ts index 2fdb0a9fe381..fe75b1561c35 100644 --- a/packages/angular-cli/models/webpack-build-common.ts +++ b/packages/angular-cli/models/webpack-build-common.ts @@ -6,8 +6,6 @@ import {BaseHrefWebpackPlugin} from '@angular-cli/base-href-webpack'; const ProgressPlugin = require('webpack/lib/ProgressPlugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); -const autoprefixer = require('autoprefixer'); - export function getWebpackCommonConfig( projectRoot: string, @@ -138,7 +136,9 @@ export function getWebpackCommonConfig( new webpack.LoaderOptionsPlugin({ test: /\.(css|scss|sass|less|styl)$/, options: { - postcss: [ autoprefixer() ] + postcss: [ + require('autoprefixer') + ] }, }) ].concat(extraPlugins), diff --git a/packages/angular-cli/models/webpack-build-production.ts b/packages/angular-cli/models/webpack-build-production.ts index caf2fc58f3e0..a1f3963286df 100644 --- a/packages/angular-cli/models/webpack-build-production.ts +++ b/packages/angular-cli/models/webpack-build-production.ts @@ -71,8 +71,10 @@ export const getWebpackProdConfigPartial = function(projectRoot: string, threshold: 10240 }), new webpack.LoaderOptionsPlugin({ + test: /\.(css|scss|sass|less|styl)$/, options: { postcss: [ + require('autoprefixer'), require('postcss-discard-comments') ] }