Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/angular-cli/models/webpack-build-common.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,7 @@ 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(
Expand DownExpand Up@@ -131,7 +132,13 @@ export function getWebpackCommonConfig(
new GlobCopyWebpackPlugin({
patterns: appConfig.assets,
globOptions: {cwd: appRoot, dot: true, ignore: '**/.gitkeep'}
})
}),
new webpack.LoaderOptionsPlugin({
test: /\.(css|scss|sass|less|styl)$/,
options: {
postcss: [ autoprefixer() ]
},
}),
],
node: {
fs: 'empty',
Expand Down
7 changes: 6 additions & 1 deletion tests/e2e/tests/build/styles/css.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,12 +8,17 @@ export default function() {
@import './imported-styles.css';

body { background-color: blue; }

div { flex: 1 }
`,
'src/imported-styles.css': `
p { background-color: red; }
`
})
.then(() => ng('build'))
.then(() => expectFileToMatch('dist/styles.bundle.js', 'body { background-color: blue; }'))
.then(() => expectFileToMatch('dist/styles.bundle.js', 'p { background-color: red; }'));
.then(() => expectFileToMatch('dist/styles.bundle.js', 'p { background-color: red; }'))
.then(() => expectFileToMatch(
'dist/styles.bundle.js',
'div { -webkit-box-flex: 1; -ms-flex: 1; flex: 1 }'));
}