-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.dev.js
46 lines (43 loc) · 1.04 KB
/
webpack.config.dev.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
var webpack = require('webpack');
var _ = require('lodash');
var config = require('./webpack.config.base');
config = _.merge(config, {
devServer: {
port: 6767,
contentBase: "./build",
hot: true,
proxy: {
'localhost:3000': {
target: 'ws://localhost:8000',
ws: true,
secure: false,
},
// '/wsapi/*': {
// target: 'ws://localhost:8000',
// ws: true,
// secure: false,
// }
}
},
entry: _.assign({}, config.entry, {
app: [
'webpack-dev-server/client?http://localhost:6767',
'webpack/hot/only-dev-server'
].concat(config.entry.app)
}),
plugins: config.plugins.concat([
new webpack.HotModuleReplacementPlugin(),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
// cant use chunkhash with HMR
filename: 'scripts/vendor.[hash:7].js',
minChunks: Infinity
})
]),
module: {
loaders: [
{loaders: ['react-hot'].concat(config.module.loaders[0].loaders)}
]
}
});
module.exports = config;