-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.config.js
34 lines (33 loc) · 1018 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
var webpack = require('webpack')
var WebpackDevServer = require('webpack-dev-server')
var config = require('./webpack.config')
const errorOverlayMiddleware = require('react-error-overlay/middleware')
const serverConfig = require('./server.config')
var proxy = require('http-proxy-middleware')
new WebpackDevServer(webpack(config), {
hot: true,
compress: true,
historyApiFallback: true,
publicPath: '/',
watchOptions: {
ignored: /node_modules/,
},
stats: {
modules: false,
chunks: false
},
setup(app) {
app.use(errorOverlayMiddleware())
if (process.env.NODE_ENV !== 'build') {
app.use('/m/*', proxy({
target: 'http://172.16.6.149:9090/',
secure: false
}))
}
}
}).listen(serverConfig.port, serverConfig.host, function (err, result) {
if (err) {
return console.log(err);
}
console.log(`Listening at http://${serverConfig.host}:${serverConfig.port}/`);
});