11var path = require ( 'path' ) ;
22var webpack = require ( 'webpack' ) ;
3- var merge = require ( 'extendify' ) ( { isDeep : true , arrays : 'concat' } ) ;
43var ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
4+
5+ var isDevBuild = process . env . ASPNETCORE_ENVIRONMENT === 'Development' ;
56var extractCSS = new ExtractTextPlugin ( 'styles.css' ) ;
6- var devConfig = require ( './webpack.config.dev' ) ;
7- var prodConfig = require ( './webpack.config.prod' ) ;
8- var isDevelopment = process . env . ASPNETCORE_ENVIRONMENT === 'Development' ;
97
10- module . exports = merge ( {
11- resolve : {
12- extensions : [ '' , '.js' , '.ts' ]
13- } ,
8+ module . exports = {
9+ devtool : isDevBuild ? 'inline-source-map' : null ,
10+ resolve : { extensions : [ '' , '.js' , '.ts' ] } ,
11+ entry : { main : [ './ClientApp/boot-client.ts' ] } ,
1412 module : {
1513 loaders : [
1614 { test : / \. t s $ / , include : / C l i e n t A p p / , loader : 'ts-loader?silent=true' } ,
1715 { test : / \. h t m l $ / , loader : 'raw-loader' } ,
1816 { test : / \. c s s / , loader : extractCSS . extract ( [ 'css' ] ) }
1917 ]
2018 } ,
21- entry : {
22- main : [ './ClientApp/boot-client.ts' ]
23- } ,
2419 output : {
2520 path : path . join ( __dirname , 'wwwroot' , 'dist' ) ,
2621 filename : '[name].js' ,
@@ -32,5 +27,9 @@ module.exports = merge({
3227 context : __dirname ,
3328 manifest : require ( './wwwroot/dist/vendor-manifest.json' )
3429 } )
35- ]
36- } , isDevelopment ? devConfig : prodConfig ) ;
30+ ] . concat ( isDevBuild ? [ ] : [
31+ // Plugins that apply in production builds only
32+ new webpack . optimize . OccurenceOrderPlugin ( ) ,
33+ new webpack . optimize . UglifyJsPlugin ( )
34+ ] )
35+ } ;
0 commit comments