fix(dev): consolidate generated cache directories
Quality / quality (ubuntu-latest) (push) Failing after 9m50s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
2026-08-12 22:25:12 +05:30
parent e638c6be6a
commit b508b49058
8 changed files with 28 additions and 13 deletions
+3 -4
View File
@@ -288,10 +288,9 @@ export async function startServer(opts: ServeOptions): Promise<RunningServer> {
const pluginContributions = await pluginRunner.contributions();
const virtualModules = new Map<string, string>();
// A live dev server and a test process can share an app root. Keeping the
// generated artifacts in a process-specific directory prevents a test boot
// from deleting the running server's client modules.
const cacheDir = join(appRoot, `.wrnexus-${process.pid}`);
// Keep generated artifacts under the single framework state directory.
// Startup clears this cache and removes legacy PID-suffixed cache folders.
const cacheDir = join(appRoot, ".wrnexus", "cache");
const virtualDir = join(cacheDir, "virtual");
mkdirSync(virtualDir, { recursive: true });
for (const [index, module] of pluginContributions.virtualModules.entries()) {