-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathserver.js
42 lines (40 loc) · 1.41 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
const fs = require('fs');
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const opener = require('opener');
const config = require('./webpack/webpack.config.actions.dev');
const host = 'localhost';
const port = 8080;
var ops = {
cert: './node_modules/webpack-dev-server/ssl/server.pem',
ca: './node_modules/webpack-dev-server/ssl/ca.pem',
key: './node_modules/webpack-dev-server/ssl/server.pem'
};
new WebpackDevServer(webpack(config), {
// All the options for webpack-dev-server here: https://webpack.js.org/configuration/devtool/
contentBase: config.output.path,
publicPath: config.output.publicPath,
// All the stats options here: https://webpack.js.org/configuration/stats/
stats: {
colors: true, // color is life
chunks: false, // this reduces the amount of stuff I see in my terminal; configure to your needs
'errors-only': true
},
https: true,
headers: {
'Access-Control-Allow-Origin': '*'
},
https: true,
//requestCert: true,
//rejectUnauthorized: true,
hot: false,
inline: false,
historyApiFallback: true
})
.listen(port, host, (err) => {
if (err) {
console.log(err);
}
console.log(`Listening at ${host}:${port}`);
//opener(`https://${host}:${port}`);
});