feat(vite): add update checker (#3372)

This commit is contained in:
Marvin Hagemeister
2025-09-09 18:52:19 +02:00
committed by GitHub
parent 5781123157
commit f773d0d359
5 changed files with 17 additions and 5 deletions
+9 -1
View File
@@ -14,7 +14,12 @@ import { clientSnapshot } from "./plugins/client_snapshot.ts";
import { serverSnapshot } from "./plugins/server_snapshot.ts";
import { patches } from "./plugins/patches.ts";
import process from "node:process";
import { specToName, UniqueNamer } from "@fresh/core/internal-dev";
import {
specToName,
UniqueNamer,
UPDATE_INTERVAL,
updateCheck,
} from "@fresh/core/internal-dev";
import { checkImports } from "./plugins/verify_imports.ts";
import { isBuiltin } from "node:module";
@@ -147,6 +152,9 @@ export function fresh(config?: FreshViteConfig): Plugin[] {
};
},
configResolved(vConfig) {
// Run update check in background
updateCheck(UPDATE_INTERVAL).catch(() => {});
fConfig.islandsDir = pathWithRoot(fConfig.islandsDir, vConfig.root);
fConfig.routeDir = pathWithRoot(fConfig.routeDir, vConfig.root);