In Angular 2 template, always load CSS via ExtractTextPlugin (otherwise you get a bad FOUC when loading server-prerendered page)

This commit is contained in:
SteveSandersonMS
2016-03-01 00:40:37 +00:00
parent f830a5f90a
commit a5509b86e4
9 changed files with 22 additions and 32 deletions

View File

@@ -1,15 +1,7 @@
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var extractCSS = new ExtractTextPlugin('site.css');
module.exports = {
module: {
loaders: [
{ test: /\.css/, exclude: /ClientApp/, loader: extractCSS.extract(['css']) },
]
},
plugins: [
extractCSS,
new webpack.optimize.UglifyJsPlugin({
minimize: true,
mangle: false // Due to https://github.com/angular/angular/issues/6678