Skip to content

Commit 35ba564

Browse files
committed
use the same index.html template for both dev and prod
1 parent c88d17c commit 35ba564

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

template/build/webpack.dev.conf.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
11
var config = require('./webpack.base.conf')
2+
var HtmlWebpackPlugin = require('html-webpack-plugin')
23

4+
// eval-source-map is faster for development
35
config.devtool = 'eval-source-map'
46

57
config.devServer = {
8+
// allow access over local network
69
host: '0.0.0.0',
10+
// enable HTML5 history routing
711
historyApiFallback: true,
8-
noInfo: true
12+
// suppress useless text
13+
noInfo: true,
914
}
1015

16+
// necessary for the html plugin to work properly
17+
// when serving the html from in-memory
18+
config.output.publicPath = '/'
19+
20+
config.plugins = (config.plugins || []).concat([
21+
// generate HTML on the fly
22+
new HtmlWebpackPlugin({
23+
filename: 'index.html',
24+
template: 'src/index.html'
25+
})
26+
])
27+
1128
module.exports = config

template/build/webpack.prod.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ config.plugins = (config.plugins || []).concat([
5050
// see https://github.com/ampedandwired/html-webpack-plugin
5151
new HtmlWebpackPlugin({
5252
filename: '../index.html',
53-
template: 'build/index.template.html'
53+
template: 'src/index.html'
5454
})
5555
])
5656

template/index.html

Lines changed: 0 additions & 11 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)