-
Notifications
You must be signed in to change notification settings - Fork 32
/
webpack-dev.config.js
46 lines (41 loc) · 1012 Bytes
/
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
let path = require('path')
let devConfig = require('./webpack.config.js');
const webpack = require('webpack');
devConfig.devtool = 'eval-source-map';
devConfig.output.publicPath = 'http://'+(require("ip").address() || 'localhost')+':8080/';
devConfig.mode = "development";
devConfig.optimization = {
nodeEnv: 'development'
}
devConfig.plugins.push(
new webpack.HotModuleReplacementPlugin()
);
devConfig.devServer = {
index: "index.html",
contentBase: path.join(__dirname, 'public'),
host: '0.0.0.0',
port: 8080,
hot: true,
disableHostCheck: true,
historyApiFallback: true,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Headers':
'Origin, X-Requested-With, Content-Type, Accept'
},
compress: true,
inline: true,
noInfo: false,
quiet: false,
open: false,
stats: {
all: undefined,
cached: false,
cachedAssets: false,
colors: true
},
};
devConfig.watchOptions = {
ignored: /node_modules/,
};
module.exports = devConfig;