In Angular2Spa template, use per-component scoped styles. Fixes common config issues like #234.

This commit is contained in:
SteveSandersonMS
2016-09-20 10:06:23 +01:00
parent cd18489f00
commit 19684f2b7d
8 changed files with 25 additions and 31 deletions

View File

@@ -1,9 +1,7 @@
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var isDevBuild = process.env.ASPNETCORE_ENVIRONMENT === 'Development';
var extractCSS = new ExtractTextPlugin('styles.css');
module.exports = {
devtool: isDevBuild ? 'inline-source-map' : null,
@@ -11,9 +9,9 @@ module.exports = {
entry: { main: ['./ClientApp/boot-client.ts'] },
module: {
loaders: [
{ test: /\.ts$/, include: /ClientApp/, loader: 'ts-loader?silent=true' },
{ test: /\.html$/, loader: 'raw-loader' },
{ test: /\.css/, loader: extractCSS.extract(['css']) }
{ test: /\.ts$/, include: /ClientApp/, loader: 'ts', query: { silent: true } },
{ test: /\.html$/, include: /ClientApp/, loader: 'raw' },
{ test: /\.css/, include: /ClientApp/, loader: 'raw' }
]
},
output: {
@@ -22,7 +20,6 @@ module.exports = {
publicPath: '/dist/'
},
plugins: [
extractCSS,
new webpack.DllReferencePlugin({
context: __dirname,
manifest: require('./wwwroot/dist/vendor-manifest.json')