Skip to content

Commit afcf853

Browse files
docs: update migration guide bundler conditions section (#8965)
#8953 / #8961 --------- Co-authored-by: Simon H <[email protected]>
1 parent 9da320b commit afcf853

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

documentation/docs/05-misc/04-v4-migration-guide.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ If you're a library author, consider whether to only support Svelte 4 or if it's
1717

1818
## Browser conditions for bundlers
1919

20-
Bundlers must now specify the browser condition when building a frontend bundle for the browser. SvelteKit and Vite will handle this automatically for you. For Rollup or webpack you may need to adjust your config to ensure it matches what is shown in the [`rollup-plugin-svelte`](https://github.com/sveltejs/rollup-plugin-svelte/#usage) and [`svelte-loader`](https://github.com/sveltejs/svelte-loader#usage) documentation. ([#8516](https://github.com/sveltejs/svelte/issues/8516))
20+
Bundlers must now specify the `browser` condition when building a frontend bundle for the browser. SvelteKit and Vite will handle this automatically for you. If you're using any others, you may observe lifecycle callbacks such as `onMount` not get called and you'll need to update the module resolution configuration.
21+
- For Rollup this is done within the `@rollup/plugin-node-resolve` plugin by setting `browser: true` in its options. See the [`rollup-plugin-svelte`](https://github.com/sveltejs/rollup-plugin-svelte/#usage) documentation for more details
22+
- For wepback this is done by adding `"browser"` to the `conditionNames` array. You may also have to update your `alias` config, if you have set it. See the [`svelte-loader`](https://github.com/sveltejs/svelte-loader#usage) documentation for more details
23+
24+
([#8516](https://github.com/sveltejs/svelte/issues/8516))
2125

2226
## Removal of CJS related output
2327

0 commit comments

Comments
 (0)