mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Change Angular2 template to use vendor DLL too. Temporarily disabled server-side prerendering.
This commit is contained in:
@@ -2,8 +2,7 @@ var path = require('path');
|
||||
var webpack = require('webpack');
|
||||
var merge = require('extendify')({ isDeep: true, arrays: 'concat' });
|
||||
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
var extractSiteCSS = new ExtractTextPlugin('styles.css');
|
||||
var extractVendorCSS = new ExtractTextPlugin('vendor.css');
|
||||
var extractCSS = new ExtractTextPlugin('styles.css');
|
||||
var devConfig = require('./webpack.config.dev');
|
||||
var prodConfig = require('./webpack.config.prod');
|
||||
var isDevelopment = process.env.ASPNET_ENV === 'Development';
|
||||
@@ -15,15 +14,12 @@ module.exports = merge({
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /\.ts$/, include: /ClientApp/, loader: 'ts-loader' },
|
||||
{ test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' },
|
||||
{ test: /\.html$/, loader: 'raw-loader' },
|
||||
{ test: /\.css/, include: /bootstrap/, loader: extractVendorCSS.extract(['css']) },
|
||||
{ test: /\.css/, exclude: /bootstrap/, loader: extractSiteCSS.extract(['css']) },
|
||||
{ test: /\.css/, loader: extractCSS.extract(['css']) }
|
||||
]
|
||||
},
|
||||
entry: {
|
||||
main: ['./ClientApp/boot-client.ts'],
|
||||
vendor: ['angular2/bundles/angular2-polyfills.js', 'bootstrap', 'style-loader', 'jquery', 'angular2/core', 'angular2/common', 'angular2/http', 'angular2/router', 'angular2/platform/browser']
|
||||
main: ['./ClientApp/boot-client.ts']
|
||||
},
|
||||
output: {
|
||||
path: path.join(__dirname, 'wwwroot', 'dist'),
|
||||
@@ -31,10 +27,10 @@ module.exports = merge({
|
||||
publicPath: '/dist/'
|
||||
},
|
||||
plugins: [
|
||||
new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }), // Maps these identifiers to the jQuery package (because Bootstrap expects it to be a global variable)
|
||||
new webpack.optimize.OccurenceOrderPlugin(),
|
||||
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'), // Moves vendor content out of other bundles
|
||||
extractSiteCSS,
|
||||
extractVendorCSS
|
||||
extractCSS,
|
||||
new webpack.DllReferencePlugin({
|
||||
context: __dirname,
|
||||
manifest: require('./wwwroot/dist/vendor-manifest.json')
|
||||
})
|
||||
]
|
||||
}, isDevelopment ? devConfig : prodConfig);
|
||||
|
||||
Reference in New Issue
Block a user