@evjs/cli 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -40,9 +40,9 @@ export async function dev(userConfig, options) {
|
|
|
40
40
|
return;
|
|
41
41
|
apiStarted = true;
|
|
42
42
|
const serverPort = config?.server?.dev?.port ?? CONFIG_DEFAULTS.serverPort;
|
|
43
|
-
const
|
|
44
|
-
const [
|
|
45
|
-
logger.info `Server bundle detected, starting ${
|
|
43
|
+
const runtimeConfig = config?.server?.runtime ?? "node";
|
|
44
|
+
const [runtime, ...runtimeExtraArgs] = runtimeConfig.split(/\s+/);
|
|
45
|
+
logger.info `Server bundle detected, starting ${runtime} API...`;
|
|
46
46
|
const bootstrapPath = path.resolve(cwd, "dist/server/_dev_start.cjs");
|
|
47
47
|
try {
|
|
48
48
|
const serverBundlePath = path.resolve(cwd, "dist/server", manifest.server.entry);
|
|
@@ -56,16 +56,16 @@ export async function dev(userConfig, options) {
|
|
|
56
56
|
`serve(app, { port: ${serverPort}, https: ${JSON.stringify(config.server.dev.https)} });`,
|
|
57
57
|
].join("\n"));
|
|
58
58
|
// node gets --watch flags; other runtimes use their own args as-is
|
|
59
|
-
const
|
|
59
|
+
const runtimeArgs = runtime === "node"
|
|
60
60
|
? [
|
|
61
61
|
"--watch",
|
|
62
62
|
"--watch-preserve-output",
|
|
63
|
-
...
|
|
63
|
+
...runtimeExtraArgs,
|
|
64
64
|
bootstrapPath,
|
|
65
65
|
]
|
|
66
|
-
: [...
|
|
66
|
+
: [...runtimeExtraArgs, bootstrapPath];
|
|
67
67
|
// Don't await execa here since it's a long-running watch process
|
|
68
|
-
execa(
|
|
68
|
+
execa(runtime, runtimeArgs, {
|
|
69
69
|
stdio: "inherit",
|
|
70
70
|
env: { ...process.env, NODE_ENV: "development" },
|
|
71
71
|
}).catch(() => {
|
|
@@ -73,7 +73,7 @@ export async function dev(userConfig, options) {
|
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
catch (err) {
|
|
76
|
-
logger.error `Server
|
|
76
|
+
logger.error `Server runtime failed: ${err}`;
|
|
77
77
|
apiStarted = false;
|
|
78
78
|
}
|
|
79
79
|
};
|