forked from lobsteropteryx/esri-webpack-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
43 lines (41 loc) · 1023 Bytes
/
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
/**
* This file runs a webpack-dev-server, using the API.
*
* For more information on the options passed to WebpackDevServer,
* see the webpack-dev-server API docs:
* https://github.com/webpack/docs/wiki/webpack-dev-server#api
*/
var WebpackDevServer = require('webpack-dev-server');
var webpack = require('webpack');
var config = require('./webpack.config.js');
var path = require('path');
var compiler = webpack(config);
var server = new WebpackDevServer(compiler, {
contentBase: 'dist',
hot: true,
host: "0.0.0.0",
filename: 'bundle.js',
publicPath: '/',
noInfo: false,
stats: {
colors: true,
},
proxy: {
"/proxy": {
"target": {
"host": "localhost",
"protocol": 'http:',
"port": 80
},
// ignorePath: true,
// changeOrigin: true,
secure: false
}
}
});
server.listen(8080, 'localhost', function (err, stats) {
if (err) {
throw new gutil.PluginError("webpack-dev-server", err);
}
console.log('DEV SERVER STARTED');
});