var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
// var ExtractTextPlugin = require('extract-text-webpack-plugin');

module.exports = function makeWebpackConfig() {

	var config = {};

	config.devtool = 'eval-source-map';

	config.entry = {
		'polyfills': './src/polyfills.ts',
		'vendor': './src/vendor.ts',
		'app': './src/main.ts'
	};

	config.output = {
		path: root('dist'),
		publicPath: 'http://localhost:8080/',
		filename: 'js/[name].js',
		chunkFilename: '[id].chunk.js'
	};

	config.resolve = {
		extensions: ['.ts', '.js']
	};

	config.module = {
		rules: [
			{
				test: /\.ts$/,
				loaders: [
					{
						loader: 'awesome-typescript-loader'
					},
					'awesome-typescript-loader'
				],
				exclude: /node_modules\/(?!(ng2-.+))/
			},
			{
				test: /\.html$/,
				use: 'raw-loader',
				exclude: [root('src/index.html')]
			}
			// {
			// 	test: /\.html$/,
			// 	loader: 'html-loader'
			// }
		]
	};

	config.plugins = [
		new webpack.ContextReplacementPlugin(
			/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
			root('./src'),
			{} // a map of your routes
		),
		new webpack.optimize.CommonsChunkPlugin({
			name: ['vendor', 'polyfills']
		}),
		new HtmlWebpackPlugin({
			template: 'src/index.html',
			chunksSortMode: 'dependency'
		})
	];

	return config;
}();

// Helper functions
function root(args) {
	args = Array.prototype.slice.call(arguments, 0);
	return path.join.apply(path, [__dirname].concat(args));
}
@@ -911,23 +911,18 @@
 %09%09%09%7D
+,
 %0A%09%09%09
-// 
 %7B%0A%09%09%09
-// 
 %09tes
@@ -931,23 +931,16 @@
  /%5C.
-html$/,%0A%09%09%09// %09
+json$/, 
 load
@@ -944,20 +944,20 @@
 oader: '
-html
+json
 -loader'
@@ -960,19 +960,16 @@
 der'%0A%09%09%09
-// 
 %7D%0A%09%09%5D%0A%09%7D
@@ -1330,16 +1330,176 @@
 %7D)%0A%09%5D;%0A%0A
+%09config.devServer = %7B%0A%09%09historyApiFallback: true,%0A%09%09quiet: true,%0A%09%09stats: 'minimal' // none (or false), errors-only, minimal, normal (or true) and verbose%0A%09%7D;%0A%0A
 %09return 

Add rules for webserver webpack config