feat(vite): add update checker (#3372)
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user