Clear the start command when the framework or adapter changes

A start command names an entrypoint belonging to one framework. Carrying it
across a switch submits it against a runtime that has no such entrypoint,
and a switch to static leaves a command the form no longer shows.

Reset it alongside the other framework-derived fields, and send it only for
the ssr adapter, matching the fallbackFile line beside it.
This commit is contained in:
harsh mahajan committed 2026-08-13 11:20:18 +05:30
1 parent 6e64d0ce57
commit 8fab5505c9
1 file changed
+3 -1
@@ -92,6 +92,7 @@
outputDirectory = data.outputDirectory;
adapter = data.key as Adapter;
fallback = data.fallbackFile;
startCommand = '';
} else if (hasFrameworkSelectionChanged) {
const data =
selectedFramework.adapters.find((a) => a.key === adapter) ??
@@ -110,6 +111,7 @@
fallback = isOriginalAdapter
? (site?.fallbackFile ?? data.fallbackFile)
: data.fallbackFile;
startCommand = isOriginalAdapter ? (site?.startCommand ?? '') : '';
}
lastFrameworkAdapterKey = `${selectedFramework.key}:${adapter ?? ''}`;
@@ -167,7 +169,7 @@
timeout: site.timeout || undefined,
installCommand: installCommand || undefined,
buildCommand: buildCommand || undefined,
startCommand: startCommand || undefined,
startCommand: adptr?.key === 'ssr' ? startCommand || undefined : undefined,
outputDirectory: outputDirectory || undefined,
buildRuntime: (site?.buildRuntime as BuildRuntime) || undefined,
adapter: (adptr?.key as Adapter) || undefined,