Implement webpack build for web interface

Set up webpack for the master server's web interface and fix the issues
from the imported interface source files.  The .jsx files in
package/master/web are bundled together into package/master/static and
served by the master server via express.
This commit is contained in:
Hornwitser committed 2020-09-28 04:23:45 +02:00
1 parent 2382f4bbdc
commit 701ff87bcd
25 files changed
+219 -191

No files matched your search

+13 -1
View File
@@ -1553,7 +1553,9 @@ async function startServer() {
})
.demandCommand(1, "You need to specify a command to run");
})
.command("run", "Run master server")
.command("run", "Run master server", yargs => {
yargs.option("dev", { hidden: true, type: "boolean", nargs: 0 });
})
.demandCommand(1, "You need to specify a command to run")
.strict()
.argv
@@ -1634,6 +1636,16 @@ async function startServer() {
// If we get here the command was run
if (args.dev) {
console.log("Development mode enabled");
const webpack = require("webpack");
const middleware = require("webpack-dev-middleware");
const webpackConfig = require("./webpack.config");
const compiler = webpack(webpackConfig({}));
app.use(middleware(compiler, {}));
}
let secondSigint = false;
process.on("SIGINT", () => {
if (secondSigint) {