The Sapper template allows you to write process.browser to determine if you're in the browser or in Node. Not sure how to do that here. Snowpack has import.meta.env which feels like the way you're supposed to go, though I'm not sure how to differentiate between SSR and not. Perhaps the isSSR boolean that gets passed around could also be used to populate import.meta.env.SSR?
The Sapper template allows you to write
process.browserto determine if you're in the browser or in Node. Not sure how to do that here. Snowpack hasimport.meta.envwhich feels like the way you're supposed to go, though I'm not sure how to differentiate between SSR and not. Perhaps theisSSRboolean that gets passed around could also be used to populateimport.meta.env.SSR?