Closed
Description
Describe the problem
currently, svelte exports ssr.mjs
for '.' when the 'node' condition is set.
This changes onMount
to be a noop and allows treeshaking bundlers to remove browser-only code and imports from ssr bundles.
but using the 'node' condition can lead to problems, eg if something deno only used 'deno' condition, it would not get ssr.mjs.
It's also not in alignment with esm-env that is going to be used by sveltekit.
Describe the proposed solution
use the browser condition, like esm-env by @benmccann
https://github.com/benmccann/esm-env
Alternatives considered
leave it as is, assuming the node condition is used for non-browser builds always
Importance
would make my life easier
Metadata
Metadata
Assignees
Labels
No labels