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
+
1
10
import * as webpack from 'webpack' ;
2
11
import { ngAppResolve } from './webpack-build-utils' ;
3
12
@@ -26,7 +35,7 @@ var components = [
26
35
'toolbar'
27
36
] ;
28
37
/** Map relative paths to URLs. */
29
- var aliasMap = {
38
+ var aliasMap : any = {
30
39
'@angular2-material/core' : ngAppResolve ( './src/core' ) ,
31
40
} ;
32
41
@@ -39,33 +48,20 @@ export const webpackMaterialConfig = {
39
48
devtool : 'inline-source-map' ,
40
49
resolve : {
41
50
extensions : [ '' , '.webpack.js' , '.web.js' , '.ts' , '.tsx' , '.js' , '.css' , '.scss' ] ,
42
- //SAVE: TODO# Don't use relative bp
43
51
root : ngAppResolve ( './' ) ,
44
- // modulesDirectory: [
45
- // ngAppResolve('./src/demo-app/'),
46
- // ngAppResolve('./src/core'),
47
- // ngAppResolve('./src/components'),
48
- // 'src/components/',
49
- // 'src/core/'
50
- // ]
51
52
alias : aliasMap
52
53
} ,
53
54
sassLoader : {
54
55
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' )
56
58
]
57
59
} ,
58
60
debug : true ,
59
61
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
- // },
65
62
entry : {
66
63
main : [ ngAppResolve ( './src/demo-app/main.ts' ) ] ,
67
64
vendor : ngAppResolve ( './src/demo-app/vendor.ts' )
68
- // main: ngAppResolve('./src/e2e-app/main.ts')
69
65
} ,
70
66
output : {
71
67
path : './dist' ,
@@ -103,25 +99,23 @@ export const webpackMaterialConfig = {
103
99
]
104
100
} ,
105
101
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
+ // // ],
114
108
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
+ // }),
125
119
new webpack . optimize . CommonsChunkPlugin ( { name : 'vendor' } ) ,
126
120
new ForkCheckerPlugin ( ) ,
127
121
new HtmlWebpackPlugin ( {
0 commit comments