feat: add isSsrTargetWebWorker flag to configEnvironment hook#18620
Conversation
There was a problem hiding this comment.
I think this is ok for v6. Do you know how we can get out of it? Do we need another option so this hack isn't needed?
Edit: oh, IIUC, we could just remove it once v5 support is no longer needed. Talking about that, I wonder if svelte will end up doing a clean cut and require Vite 6 soon after we release
There was a problem hiding this comment.
I'm personally still a bit unsure that resolve.conditions now exclusively only applies to client is a nice behaviour, especially that we try to match compat for the environment API, but I don't think it's worth spiraling into that discussion for now 😅 I'll try to test some things locally on my own.
Dominik is fine with that for vite-plugin-svelte, but we'll likely have to align with sveltekit and the plan could change. |
Description
This PR adds
isSsrTargetWebWorkerflag toconfigEnvironmenthook so that plugins can supportssr.target: 'webworker'correctly.For example, this
configEnvironmenthook from sveltejs/vite-plugin-svelte#1020 needs to know ifssr.target: 'webworker'is set.https://github.com/sveltejs/vite-plugin-svelte/blob/dcec9afa2a9b1bfd5fe8f0767cc871a2b144a9d6/packages/vite-plugin-svelte/src/index.js#L71-L81
https://discord.com/channels/804011606160703521/1304311237332697098/1304350474085859338