-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.js
More file actions
32 lines (27 loc) · 818 Bytes
/
dev.js
File metadata and controls
32 lines (27 loc) · 818 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
require('babel-register');
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.config');
var path = require('path');
var appPort = 1337;
var proxy = 'http://localhost:' + appPort;
var devServer = new WebpackDevServer(webpack(config), {
contentBase: config.output.path,
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true,
stats: 'errors-only',
proxy: [
{
path: /^(?!\/public).*$/,
secure: false,
target: proxy
}
]
});
var appConfig = require('./src/instance/config').default;
devServer.listen(appConfig.port, 'localhost', function () {
console.log('Listening at http://%s:%s', 'localhost', appConfig.port);
});
var app = require('./src/instance/app').default;
app.listen(appPort);