-
Notifications
You must be signed in to change notification settings - Fork 22
/
dev_server.js
34 lines (32 loc) · 961 Bytes
/
dev_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
34
const { resolve } = require('path');
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const config = require('./webpack.dev');
const npm_config = require('./package.json');
const PORT = process.env.PORT || 3000;
new WebpackDevServer(webpack(config), {
contentBase: resolve(__dirname, 'dist'),
publicPath: '/',
hot: false,
historyApiFallback: true,
quiet: false,
noInfo: false,
proxy: npm_config.proxy,
stats: {
assets: false,
colors: true,
version: false,
hash: false,
timings: true,
children: false,
modules: false,
chunks: false,
chunkModules: false
}
}).listen(PORT, 'localhost', function(err){
if(err){
console.log(err);
}
console.log('\x1b[36m%s\x1b[33m%s\x1b[0m', 'Dev server running at ', 'localhost:' + PORT);
console.log('\x1b[32m%s\x1b[0m', '\nWebpack compiling...\n');
});