diff --git a/scripts/lib/dev-release-manifest.ts b/scripts/lib/dev-release-manifest.ts index 4b718ab5..0395cd6a 100644 --- a/scripts/lib/dev-release-manifest.ts +++ b/scripts/lib/dev-release-manifest.ts @@ -4,8 +4,12 @@ import path from "node:path"; import type { Plugin } from "vite"; -/** Generated at dev server start; ignored with the rest of src/.generated/. */ -export const DEV_RELEASE_MANIFEST_PATH = "src/.generated/dev-release-manifest.json"; +/** + * Generated at dev server start, beside the build's generated contract set and + * ignored with it. Not under src/: the removal drills scan src/ for the + * sample's names, and this copies the placeholder's route chunks. + */ +export const DEV_RELEASE_MANIFEST_PATH = ".generated/frontend-runtime/dev-release-manifest.json"; /** * Serve only. The dev server answers the runtime's release-manifest request @@ -19,7 +23,9 @@ export const DEV_RELEASE_MANIFEST_PATH = "src/.generated/dev-release-manifest.js export function devReleaseManifestPlugin(repositoryRoot = process.cwd()): Plugin { return { name: "frontend-dev-release-manifest", - apply: "serve", + // Vitest also starts Vite in serve mode; tests never fetch the manifest + // from a server, so they skip the child process. + apply: (_config, env) => env.command === "serve" && !process.env["VITEST"], configureServer(server) { execFileSync( process.execPath, diff --git a/scripts/write-dev-release-manifest.ts b/scripts/write-dev-release-manifest.ts index bd194eb4..48a6c75a 100644 --- a/scripts/write-dev-release-manifest.ts +++ b/scripts/write-dev-release-manifest.ts @@ -10,7 +10,7 @@ import { DEV_RELEASE_MANIFEST_PATH } from "./lib/dev-release-manifest.ts"; * installed now. Boot checks that set against the installed declarations, so * a placeholder with a fixed set refused every app with one more feature * (CONTRACT_SET_PACKAGE_MISSING) until someone edited it by hand. The output - * is generated and ignored, as src/.generated/ is. + * is generated and ignored, as .generated/ is. */ export async function writeDevReleaseManifest( source = "public/release-manifest.json",