Skip to content

Commit

Permalink
fix: Stub out __VITE_PRELOAD__ during prerender (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed Jun 23, 2024
1 parent 76e9409 commit c6c7a0b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/prerender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ export function PrerenderPlugin({
// @ts-ignore
globalThis.self = globalThis;

// As of Vite 5.3.0-beta.0, Vite injects an undefined `__VITE_PRELOAD__` var
// Swapping in an empty array is fine as we have no need to preload whilst prerendering
// https://github.com/vitejs/vite/pull/16562
// @ts-ignore
globalThis.__VITE_PRELOAD__ = [];

// Local, fs-based fetch implementation for prerendering
const nodeFetch = globalThis.fetch;
// @ts-ignore
Expand Down

0 comments on commit c6c7a0b

Please sign in to comment.