-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.config.js
55 lines (47 loc) · 1.2 KB
/
webpack.dev.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
'use strict';
var path = require('path');
var webpack = require('webpack');
var config = require('./webpack.base.config.js');
var update = require('react-addons-update');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin');
config = update(config, {
mode: { $set: 'development' },
entry: { $set: ['babel-polyfill', './src/entry/index.jsx'] },
devtool: { $set: 'eval-source-map' },
output: {
$set: {
path: path.resolve(__dirname, 'public'),
pathinfo: true,
publicPath: 'http://localhost:3456/',
filename: 'main.js'
}
},
plugins: {
$push: [
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
alwaysWriteToDisk: true,
inject: true,
filename: 'index.html',
template: 'src/views/index.html'
}),
new HtmlWebpackHarddiskPlugin()
]
},
devServer: {
$set: {
publicPath: '/',
host: "0.0.0.0",
port: 3456,
contentBase: path.join(__dirname, "./public"),
inline: true,
hot: true,
stats: {
colors: true
},
historyApiFallback: true
}
}
});
module.exports = config;