forked from FirefoxUX/photon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.js
More file actions
31 lines (25 loc) · 710 Bytes
/
run.js
File metadata and controls
31 lines (25 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
30
31
'use strict';
var express = require('express');
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var frontendConfig = require('./webpack.config.js');
var pages = frontendConfig.pages
.map(x => {
if (x.directory) {
return `/${x.directory}/${x.file}`;
}
return `/${x.file}`;
});
new WebpackDevServer(webpack(frontendConfig), {
publicPath: frontendConfig.output.publicPath,
hot: true,
contentBase: 'dist',
proxy: [{
context: pages,
target: 'http://localhost:3000/index.html',
pathRewrite: {'/.*\.html' : ''}
}]
}).listen(3000, '0.0.0.0', function () {});
var app = express();
app.use(express.static('.'));
app.listen(4000);