Problem
In packages/static/src/build/buildApp.ts, both the RSC entry import and all output writes use the configured outDir values directly:
const entryPath = path.join(config.environments.rsc.build.outDir, "index.js");
// ...imported via pathToFileURL(entryPath)
const baseDir = config.environments.client.build.outDir;
outDir may be a relative path, in which case these resolve against process.cwd(). If vite build is run from a directory other than the Vite root (e.g. monorepo root with --config), the entry import fails or output is written to the wrong location.
serverPlugin in packages/static/src/plugin/server.ts already handles this correctly with path.resolve(config.root, config.environments.client.build.outDir).
Suggested fix
Resolve both paths against config.root in buildApp. Note this also affects the outDir passed to the user's custom build entry (BuildEntryContext.outDir), which is documented as an absolute path but currently may not be.
Found during a framework audit.
Problem
In
packages/static/src/build/buildApp.ts, both the RSC entry import and all output writes use the configuredoutDirvalues directly:outDirmay be a relative path, in which case these resolve againstprocess.cwd(). Ifvite buildis run from a directory other than the Vite root (e.g. monorepo root with--config), the entry import fails or output is written to the wrong location.serverPlugininpackages/static/src/plugin/server.tsalready handles this correctly withpath.resolve(config.root, config.environments.client.build.outDir).Suggested fix
Resolve both paths against
config.rootinbuildApp. Note this also affects theoutDirpassed to the user's custom build entry (BuildEntryContext.outDir), which is documented as an absolute path but currently may not be.Found during a framework audit.