Skip to content

Commit 6e1a89b

Browse files
grizzm0MRHarrison
authored andcommitted
fix(build): added autoprefixer to prod
Fix angular#3156 Close angular#3164
1 parent e48dd6e commit 6e1a89b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/angular-cli/models/webpack-build-common.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import {BaseHrefWebpackPlugin} from '@angular-cli/base-href-webpack';
66

77
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
88
const HtmlWebpackPlugin = require('html-webpack-plugin');
9-
const autoprefixer = require('autoprefixer');
10-
119

1210
export function getWebpackCommonConfig(
1311
projectRoot: string,
@@ -138,7 +136,9 @@ export function getWebpackCommonConfig(
138136
new webpack.LoaderOptionsPlugin({
139137
test: /\.(css|scss|sass|less|styl)$/,
140138
options: {
141-
postcss: [ autoprefixer() ]
139+
postcss: [
140+
require('autoprefixer')
141+
]
142142
},
143143
})
144144
].concat(extraPlugins),

packages/angular-cli/models/webpack-build-production.ts

+2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ export const getWebpackProdConfigPartial = function(projectRoot: string,
7171
threshold: 10240
7272
}),
7373
new webpack.LoaderOptionsPlugin({
74+
test: /\.(css|scss|sass|less|styl)$/,
7475
options: {
7576
postcss: [
77+
require('autoprefixer'),
7678
require('postcss-discard-comments')
7779
]
7880
}

0 commit comments

Comments
 (0)