| 
									
										
										
										
											2016-04-13 19:20:51 +02:00
										 |  |  | // #docregion
 | 
					
						
							|  |  |  | var webpack = require('webpack'); | 
					
						
							|  |  |  | var HtmlWebpackPlugin = require('html-webpack-plugin'); | 
					
						
							|  |  |  | var ExtractTextPlugin = require('extract-text-webpack-plugin'); | 
					
						
							|  |  |  | var helpers = require('./helpers'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | module.exports = { | 
					
						
							|  |  |  |   // #docregion entries
 | 
					
						
							|  |  |  |   entry: { | 
					
						
							|  |  |  |     'polyfills': './src/polyfills.ts', | 
					
						
							|  |  |  |     'vendor': './src/vendor.ts', | 
					
						
							|  |  |  |     'app': './src/main.ts' | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   // #enddocregion
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // #docregion resolve
 | 
					
						
							|  |  |  |   resolve: { | 
					
						
							|  |  |  |     extensions: ['', '.js', '.ts'] | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   // #enddocregion resolve
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // #docregion loaders
 | 
					
						
							|  |  |  |   module: { | 
					
						
							|  |  |  |     loaders: [ | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         test: /\.ts$/, | 
					
						
							| 
									
										
										
										
											2016-07-05 00:46:57 +02:00
										 |  |  |         loaders: ['ts', 'angular2-template-loader'] | 
					
						
							| 
									
										
										
										
											2016-04-13 19:20:51 +02:00
										 |  |  |       }, | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         test: /\.html$/, | 
					
						
							|  |  |  |         loader: 'html' | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/, | 
					
						
							|  |  |  |         loader: 'file?name=assets/[name].[hash].[ext]' | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         test: /\.css$/, | 
					
						
							|  |  |  |         exclude: helpers.root('src', 'app'), | 
					
						
							|  |  |  |         loader: ExtractTextPlugin.extract('style', 'css?sourceMap') | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         test: /\.css$/, | 
					
						
							|  |  |  |         include: helpers.root('src', 'app'), | 
					
						
							|  |  |  |         loader: 'raw' | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |     ] | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   // #enddocregion loaders
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // #docregion plugins
 | 
					
						
							|  |  |  |   plugins: [ | 
					
						
							|  |  |  |     new webpack.optimize.CommonsChunkPlugin({ | 
					
						
							|  |  |  |       name: ['app', 'vendor', 'polyfills'] | 
					
						
							|  |  |  |     }), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     new HtmlWebpackPlugin({ | 
					
						
							|  |  |  |       template: 'src/index.html' | 
					
						
							|  |  |  |     }) | 
					
						
							|  |  |  |   ] | 
					
						
							|  |  |  |   // #enddocregion plugins
 | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | // #enddocregion
 | 
					
						
							|  |  |  | 
 |