From 8d578b321282c5893ca186b413ca4b00ef212633 Mon Sep 17 00:00:00 2001 From: Kristofer Karlsson Date: Wed, 16 Nov 2016 20:23:38 +0100 Subject: [PATCH] Added autoprefixer to prod --- 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 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') ] }