mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 23:33:13 +09:00
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:
1 parent
2382f4bbdc
commit
701ff87bcd
25 files changed
+219
-191
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user