@@ -5,18 +5,30 @@ const path = require('path');
55const ForkCheckerPlugin = require ( 'awesome-typescript-loader' ) . ForkCheckerPlugin ;
66const CopyWebpackPlugin = require ( 'copy-webpack-plugin' ) ;
77const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
8+ const DebugWebpackPlugin = require ( 'debug-webpack-plugin' ) ;
89
910export const webpackCommonConfig = {
1011 devtool : 'inline-source-map' ,
1112 resolve : {
1213 extensions : [ '' , '.ts' , '.js' ] ,
13- root : ngAppResolve ( './src' )
14+ //SAVE: TODO# Don't use relative bp
15+ root : ngAppResolve ( '/src/demo-app' ) ,
16+ alias : {
17+ "@angular2-material/core" : ngAppResolve ( './src/core' ) ,
18+ "@angular2-material" : ngAppResolve ( './src/components' )
19+ }
1420 } ,
21+ debug : true ,
1522 context : path . resolve ( __dirname , './' ) ,
23+ //SAVE entry: {
24+ // main: [ngAppResolve('./src/main.ts')],
25+ // vendor: ngAppResolve('./src/vendor.ts'),
26+ // polyfills: ngAppResolve('./src/polyfills.ts')
27+ // },
1628 entry : {
17- main : [ ngAppResolve ( './src/main.ts' ) ] ,
18- vendor : ngAppResolve ( './src/vendor .ts' ) ,
19- polyfills : ngAppResolve ( './src/polyfills .ts' )
29+ main : [ ngAppResolve ( './src/demo-app/ main.ts' ) ] ,
30+ // core : ngAppResolve('./src/core/core .ts'),
31+ // main : ngAppResolve('./src/e2e-app/main .ts')
2032 } ,
2133 output : {
2234 path : ngAppResolve ( './dist' ) ,
@@ -40,12 +52,13 @@ export const webpackCommonConfig = {
4052 {
4153 loader : 'awesome-typescript-loader' ,
4254 query : {
43- useWebpackText : true ,
44- tsconfig : ngAppResolve ( './src/tsconfig.json' ) ,
45- resolveGlobs : false ,
55+ // useWebpackText: true,
56+ tsconfig : ngAppResolve ( './src/demo-app/tsconfig.json' ) ,
57+ // SAVE tsconfig: ngAppResolve('./src/tsconfig.json'),
58+ // resolveGlobs: false,
4659 module : "es2015" ,
4760 target : "es5" ,
48- library : 'es6' ,
61+ // library: 'es6',
4962 useForkChecker : true
5063 }
5164 } ,
@@ -65,21 +78,46 @@ export const webpackCommonConfig = {
6578 ]
6679 } ,
6780 plugins : [
81+ new CopyWebpackPlugin ( [
82+ { from : ngAppResolve ( './src/core' ) , to : ngAppResolve ( './dist/core' ) }
83+ { from : ngAppResolve ( './src/components' ) , to : ngAppResolve ( './dist/components' ) }
84+ ] ) ,
85+ new DebugWebpackPlugin ( {
86+ // Defaults to ['webpack:*'] which can be VERY noisy, so try to be specific
87+ // scope: [
88+ // 'webpack:compiler:*', // include compiler logs
89+ // 'webpack:plugin:ExamplePlugin' // include a specific plugin's logs
90+ // ],
91+
92+ // // Inspect the arguments passed to an event
93+ // // These are triggered on emits
94+ // listeners: {
95+ // 'webpack:compiler:run': function(compiler) {
96+ // // Read some data out of the compiler
97+ // }
98+ // },
99+ // Defaults to the compiler's setting
100+ debug : true ;
101+ } )
68102 new ForkCheckerPlugin ( ) ,
103+ //SAVE new HtmlWebpackPlugin({
104+ // template: ngAppResolve('src/index.html'),
105+ // chunksSortMode: 'dependency'
106+ // }),
69107 new HtmlWebpackPlugin ( {
70- template : ngAppResolve ( 'src/index.html' ) ,
71- chunksSortMode : 'dependency'
72- } ) ,
73- new webpack . optimize . CommonsChunkPlugin ( {
74- name : [ 'polyfills' , 'vendor' ] . reverse ( )
75- } ) ,
76- new webpack . optimize . CommonsChunkPlugin ( {
77- minChunks : Infinity ,
78- name : 'inline' ,
79- filename : 'inline.js' ,
80- sourceMapFilename : 'inline.map'
108+ template : ngAppResolve ( './src/demo-app/index.html' ) ,
81109 } ) ,
82- new CopyWebpackPlugin ( [ { from : ngAppResolve ( './public' ) , to : ngAppResolve ( './dist/public' ) } ] )
110+ // new webpack.optimize.CommonsChunkPlugin('core'),
111+ //SAVE new webpack.optimize.CommonsChunkPlugin({
112+ // name: ['polyfills', 'vendor'].reverse()
113+ // }),
114+ // new webpack.optimize.CommonsChunkPlugin({
115+ // minChunks: Infinity,
116+ // name: 'inline',
117+ // filename: 'inline.js',
118+ // sourceMapFilename: 'inline.map'
119+ // })
120+ // new CopyWebpackPlugin([{from: ngAppResolve('./public'), to: ngAppResolve('./dist/public')}])
83121 ] ,
84122 node : {
85123 global : 'window' ,
0 commit comments