preactjs / preset-vite

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

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

Closed rschristian closed 2 months ago

rschristian commented 3 months 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 2 months ago

Thanks!