preactjs / preset-vite

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

refactor: Provide original, unpatched fetch impl on globalThis #140

Closed rschristian closed 3 days ago

rschristian commented 2 weeks ago

originalFetch? vanillaFetch? Fetch? Naming is hard, certainly looking for better names if ya got 'em.


Current setup makes it a bit more verbose to provide your own fetch impl, as we override without providing any way for consumers to get the original. You'd have to add globalThis.unpatchedFetch = globalThis.fetch; into your Vite config file for later retrieval in your app, which isn't ideal.

rschristian commented 3 days ago

Thanks!