Fix warning with vite dev
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user