-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
44 lines (39 loc) · 1.08 KB
/
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
35
36
37
38
39
40
41
42
43
44
var webpack = require('webpack');
var path = require('path');
var WebpackDevServer = require('webpack-dev-server');
var argv = require('minimist')(process.argv.slice(2));
var configDev = require('./webpack.dev.config');
var configDevProd = require('./webpack.dev-prod.config');
var config = configDev;
if (argv.env === 'prod') {
config = configDevProd;
}
new WebpackDevServer(webpack(config), {
//publicPath: path to your bundle
publicPath: '/js',
contentBase: [path.join(__dirname),
path.join(__dirname, '/src')],
stats: {
colors: true,
hash: false,
version: false,
timings: true,
assets: false,
chunks: false,
modules: false,
reasons: false,
children: false,
source: false,
errors: true,
errorDetails: true,
warnings: false,
publicPath: false
},
hot: true,
historyApiFallback: true
}).listen(3000, 'localhost', function (err, result) {
if (err) {
return console.log(err);
}
console.log('Listening at http://localhost:3000/');
});