preactjs / preset-vite

Preset for using Preact with the vite bundler
https://npm.im/@preact/preset-vite
MIT License
260 stars 26 forks source link

fix: Stub out `__VITE_PRELOAD__` during prerender #126

Closed rschristian closed 4 months ago

rschristian commented 4 months ago

Closes #125

Dynamic imports now result in something like this:

(()=>import("./index-kayMhHeV.js"),__VITE_PRELOAD__)

Which then throws as Vite hasn't subbed it out.

It used to be a string like so:

(()=>import("./index-kayMhHeV.js"),"__VITE_PRELOAD__")

for reasons even the Vite team wasn't clear on (see reference in change)