forked from vesparny/react-kickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevServer.js
More file actions
executable file
路32 lines (26 loc) 路 784 Bytes
/
Copy pathdevServer.js
File metadata and controls
executable file
路32 lines (26 loc) 路 784 Bytes
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
var path = require('path');
var express = require('express');
var webpack = require('webpack');
var config = require('./webpack.config.dev');
var app = express();
var compiler = webpack(config);
app.use(require('webpack-dev-middleware')(compiler, {
publicPath: config.output.publicPath,
contentBase: 'src',
stats: {
colors: true,
hash: false,
timings: true,
chunks: false,
chunkModules: false,
modules: false
}
}));
app.use(require('webpack-hot-middleware')(compiler));
app.use(express.static(__dirname + '/dist'));
app.listen(config._hotPort, 'localhost', function(err) {
if (err) {
console.log(err);
}
console.info("==> 馃寧 Listening on port %s. Open up http://localhost:%s/ in your browser.", config._hotPort, config._hotPort);
});