feat: configure workspace environment runtimes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@wrnexus/dev-server",
|
||||
"version": "0.2.66",
|
||||
"version": "0.2.67",
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
"exports": {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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 "),
|
||||
|
||||
Reference in New Issue
Block a user