-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathserver.js
More file actions
29 lines (24 loc) · 710 Bytes
/
server.js
File metadata and controls
29 lines (24 loc) · 710 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
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.config');
// Start watching and bundling tests here
var tests = require('./webpack.test.config');
var testsCompiler = webpack(tests);
testsCompiler.watch({}, function (err) {
if (err) console.log(err);
//console.log('Test file bundled');
});
var serverOpts = {
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true,
stats: { colors: true }
};
// Primary app
new WebpackDevServer(webpack(config), serverOpts)
.listen(3000, 'localhost', function (err) {
if (err) {
console.log(err);
}
console.log('Listening at localhost:3000');
});