-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
33 lines (30 loc) · 928 Bytes
/
server.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
import Webpack from 'webpack';
import WebpackDevServer from 'webpack-dev-server';
import config from './webpack.config';
import ip from 'ip';
const devServerConfig = {
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true,
// It suppress error shown in console, so it has to be set to false.
quiet: false,
// It suppress everything except error, so it has to be set to false as well
// to see success build.
noInfo: false,
stats: {
assets: false,
colors: true,
version: false,
hash: false,
timings: false,
chunks: false,
chunkModules: false
}
}
new WebpackDevServer(Webpack(config), devServerConfig)
.listen(process.env.PORT || 3000, process.env.HOST || '0.0.0.0' , (err) => {
if (err) {
console.log(err);
}
console.log(`Listening at ${process.env.HOST || '0.0.0.0'}:${process.env.PORT || 3000}`);
});