-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.dev.config.js
52 lines (49 loc) · 1.26 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
const path = require('path');
const webpack = require('webpack');
const webpackBaseConfig = require('./webpack.base.config.js');
module.exports = Object.assign({}, webpackBaseConfig, {
devtool: 'inline-source-map',
entry: Object.keys(webpackBaseConfig.entry).reduce((result, k) => {
result[k] = [
'react-hot-loader/patch',
'webpack/hot/only-dev-server',
...webpackBaseConfig.entry[k],
];
return result;
}, {}),
output: Object.assign({}, webpackBaseConfig.output, {
publicPath: '/',
}),
plugins: [
...webpackBaseConfig.plugins,
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.NamedModulesPlugin(),
new webpack.DefinePlugin({
'process.env': { NODE_ENV: JSON.stringify('development') }
}),
],
devServer: {
host: '0.0.0.0',
port: '4000',
inline: true,
hot: true,
stats: {
assets: true,
colors: true,
version: false,
hash: false,
timings: false,
chunks: false,
chunkModules: false,
},
historyApiFallback: true,
contentBase: 'server',
publicPath: '/',
quiet: false,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Credentials': 'false'
},
},
});