feat: configure workspace environment runtimes

This commit is contained in:
2026-07-20 09:22:26 +05:30
parent 3888453e0d
commit b3e5e5b999
58 changed files with 183 additions and 103 deletions
+9 -1
View File
@@ -70,6 +70,7 @@ export interface GatewayOptions {
hostname?: string;
mode?: "development" | "production";
environment?: string;
hmr?: boolean;
apps: GatewayApp[];
security?: GatewaySecurity;
}
@@ -348,7 +349,14 @@ export async function startGateway(opts: GatewayOptions): Promise<RunningGateway
})
: spawn(
process.execPath,
[serveEntry, join(dir, "app"), String(appPort), mode, "127.0.0.1"],
[
serveEntry,
join(dir, "app"),
String(appPort),
mode,
"127.0.0.1",
String(opts.hmr ?? true),
],
{
stdio: "inherit",
env: {
+2 -1
View File
@@ -13,7 +13,7 @@ import { startServer } from "./index.ts";
import { loadAppConfig, headToString, findStyleEntry, renderFontHead } from "@wrnexus/styles";
import type { Mode } from "@wrnexus/core";
const [appDir, portStr, modeStr, hostname] = process.argv.slice(2);
const [appDir, portStr, modeStr, hostname, hmrStr] = process.argv.slice(2);
const mode = (modeStr as Mode) || "development";
const port = Number(portStr) || 3000;
@@ -28,6 +28,7 @@ const server = await startServer({
port,
hostname,
mode,
hmr: hmrStr === undefined ? undefined : hmrStr === "true",
styleEntry,
stylesConfig: config.styles,
head: [renderFontHead(config.fonts), headToString(config.head)].filter(Boolean).join("\n "),