SvelteStack / svelte-query

Performant and powerful remote data synchronization for Svelte
https://sveltequery.vercel.app
MIT License
813 stars 31 forks source link

Broadcaster is required as a dependency even when not using it (sveltekit) #78

Open saturnonearth opened 2 years ago

saturnonearth commented 2 years ago

When using this with SvelteKit (Vite), it gives an error that you must install Broadcaster as a dependency, increasing the overall package size, even if you are not using that feature.

Kage0x3B commented 1 year ago

I've experienced the same issue and found a temporary workaround, using a vite plugin which properly excludes the unused import from the suggested code in this issue and then excluding the broadcast-channel dependency with:

plugins: [sveltekit(), viteIgnoreStaticImport(['broadcast-channel'])],