Fix warning with vite dev

This commit is contained in:
2026-11-11 14:46:51 -03:00
parent 216d54a0ae
commit 8aa05e104d
9 changed files with 132 additions and 42 deletions
+26
View File
@@ -102,6 +102,32 @@ export class ProdBuildCache<State> implements BuildCache<State> {
}
}
/** Fallback build cache for when there's no build output (and for tests). */
export class MockBuildCache<State> implements BuildCache<State> {
#files: FsRouteFile<State>[];
root = "";
clientEntry = "";
islandRegistry: ServerIslandRegistry = new Map();
features = { errorOverlay: false };
constructor(files: FsRouteFile<State>[], mode: "development" | "production") {
this.features.errorOverlay = mode === "development";
this.#files = files;
}
getEntryAssets(): string[] {
return [];
}
getFsRoutes(): Command<State>[] {
return fsItemsToCommands(this.#files);
}
readFile(_pathname: string): Promise<StaticFile | null> {
return Promise.resolve(null);
}
}
export class IslandPreparer {
#namer = new UniqueNamer();