From 539118364af5c325aba987ced474f023bc6d4d6b Mon Sep 17 00:00:00 2001 From: Ruchir Sachdeva Date: Wed, 12 Oct 2016 16:10:07 +0700 Subject: [PATCH] devServer.historyApiFallback with HtmlWebpackPlugin was fixed. https://github.com/webpack/webpack-dev-server/issues/640 --- config/webpack.aot.js | 6 ------ config/webpack.common.js | 5 +++++ package.json | 2 +- src/index.html | 3 --- src/index.prod.html | 25 ------------------------- 5 files changed, 6 insertions(+), 35 deletions(-) delete mode 100644 src/index.prod.html diff --git a/config/webpack.aot.js b/config/webpack.aot.js index 6cea97e..dc89b42 100644 --- a/config/webpack.aot.js +++ b/config/webpack.aot.js @@ -3,8 +3,6 @@ const webpack = require('webpack'); const webpackMerge = require('webpack-merge'); const commonConfig = require('./webpack.common.js'); -const HtmlWebpackPlugin = require('html-webpack-plugin'); - const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; const API_URL = process.env.API_URL || ''; @@ -30,10 +28,6 @@ module.exports = webpackMerge(commonConfig, { chunkFilename: '[id].[chunkhash].chunk.js' }, plugins: [ - new HtmlWebpackPlugin({ - template: 'src/index.prod.html', - chunksSortMode: 'dependency', - }), new webpack.DefinePlugin({ 'ENV': JSON.stringify(ENV), 'API_URL': JSON.stringify(API_URL) diff --git a/config/webpack.common.js b/config/webpack.common.js index 0bb746c..a5bb139 100644 --- a/config/webpack.common.js +++ b/config/webpack.common.js @@ -1,6 +1,7 @@ const webpack = require('webpack'); const helpers = require('./helpers'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); const ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin; module.exports = { @@ -28,6 +29,10 @@ module.exports = { ] }, plugins: [ + new HtmlWebpackPlugin({ + template: 'src/index.html', + chunksSortMode: 'dependency', + }), new ForkCheckerPlugin(), new webpack.ContextReplacementPlugin( /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/, diff --git a/package.json b/package.json index 43c9fd9..5716f0c 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "tslint-loader": "^2.1.3", "typescript": "^2.0.3", "webpack": "2.1.0-beta.25", - "webpack-dev-server": "^2.1.0-beta.8", + "webpack-dev-server": "^2.1.0-beta.9", "webpack-merge": "~0.14.1" } } diff --git a/src/index.html b/src/index.html index 447afd2..31645fc 100644 --- a/src/index.html +++ b/src/index.html @@ -21,8 +21,5 @@ ga('create', 'UA-74585747-1', 'auto'); ga('send', 'pageview'); - - - diff --git a/src/index.prod.html b/src/index.prod.html deleted file mode 100644 index 31645fc..0000000 --- a/src/index.prod.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - Spring Boot and Angular2 tutorial - - - - - - - - - -