1+ // Angular Material2 Custom CLI Webpack Plugin: This allows for the following:
2+ // To build, serve, and watchmode the angular2-material repo.
3+ //
4+ // Requirements:
5+ //
6+ // Do a find and replace on the src directory
7+ // .css'] => .scss']
8+ // This allows for angular2-template-loader to transpile the sass correctly.
9+
110import * as webpack from 'webpack' ;
211import { ngAppResolve } from './webpack-build-utils' ;
312
@@ -26,7 +35,7 @@ var components = [
2635 'toolbar'
2736] ;
2837/** Map relative paths to URLs. */
29- var aliasMap = {
38+ var aliasMap : any = {
3039 '@angular2-material/core' : ngAppResolve ( './src/core' ) ,
3140} ;
3241
@@ -39,33 +48,20 @@ export const webpackMaterialConfig = {
3948 devtool : 'inline-source-map' ,
4049 resolve : {
4150 extensions : [ '' , '.webpack.js' , '.web.js' , '.ts' , '.tsx' , '.js' , '.css' , '.scss' ] ,
42- //SAVE: TODO# Don't use relative bp
4351 root : ngAppResolve ( './' ) ,
44- // modulesDirectory: [
45- // ngAppResolve('./src/demo-app/'),
46- // ngAppResolve('./src/core'),
47- // ngAppResolve('./src/components'),
48- // 'src/components/',
49- // 'src/core/'
50- // ]
5152 alias : aliasMap
5253 } ,
5354 sassLoader : {
5455 includePaths : [
55- ngAppResolve ( './src/demo-app/style' )
56+ // This allows for automatic resolving of @import's for sass for variables.
57+ ngAppResolve ( './src/core/style' )
5658 ]
5759 } ,
5860 debug : true ,
5961 context : path . resolve ( __dirname , './' ) ,
60- //SAVE entry: {
61- // main: [ngAppResolve('./src/main.ts')],
62- // vendor: ngAppResolve('./src/vendor.ts'),
63- // polyfills: ngAppResolve('./src/polyfills.ts')
64- // },
6562 entry : {
6663 main : [ ngAppResolve ( './src/demo-app/main.ts' ) ] ,
6764 vendor : ngAppResolve ( './src/demo-app/vendor.ts' )
68- // main: ngAppResolve('./src/e2e-app/main.ts')
6965 } ,
7066 output : {
7167 path : './dist' ,
@@ -103,25 +99,23 @@ export const webpackMaterialConfig = {
10399 ]
104100 } ,
105101 plugins : [
106- // new webpack.NormalModuleReplacementPlugin(/@angular2-material\/core/, require.resolve(ngAppResolve('./src/core/core.ts'))),
107- // new webpack.NormalModuleReplacementPlugin(/@angular2-material\//, ngAppResolve('./src/components')),
108- new DebugWebpackPlugin ( {
109- // Defaults to ['webpack:*'] which can be VERY noisy, so try to be specific
110- // scope: [
111- // 'webpack:compiler:*', // include compiler logs
112- // 'webpack:plugin:ExamplePlugin' // include a specific plugin's logs
113- // ],
102+ // new DebugWebpackPlugin({
103+ // // Defaults to ['webpack:*'] which can be VERY noisy, so try to be specific
104+ // // scope: [
105+ // // 'webpack:compiler:*', // include compiler logs
106+ // // 'webpack:plugin:ExamplePlugin' // include a specific plugin's logs
107+ // // ],
114108
115- // // Inspect the arguments passed to an event
116- // // These are triggered on emits
117- // listeners: {
118- // 'webpack:compiler:run': function(compiler) {
119- // // Read some data out of the compiler
120- // }
121- // },
122- // Defaults to the compiler's setting
123- debug : true
124- } ) ,
109+ // // // Inspect the arguments passed to an event
110+ // // // These are triggered on emits
111+ // // listeners: {
112+ // // 'webpack:compiler:run': function(compiler) {
113+ // // // Read some data out of the compiler
114+ // // }
115+ // // },
116+ // // Defaults to the compiler's setting
117+ // debug: true
118+ // }),
125119 new webpack . optimize . CommonsChunkPlugin ( { name : 'vendor' } ) ,
126120 new ForkCheckerPlugin ( ) ,
127121 new HtmlWebpackPlugin ( {
0 commit comments