Skip to content

Commit

Permalink
docs: update migration guide bundler conditions section (sveltejs#8965)
Browse files Browse the repository at this point in the history
sveltejs#8953 / sveltejs#8961 

---------

Co-authored-by: Simon H <[email protected]>
  • Loading branch information
2 people authored and Ennoriel committed Jul 25, 2023
1 parent 6b6fd72 commit 1457d5b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion documentation/docs/05-misc/04-v4-migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ Si vous êtes l'auteur d'une librairie, considérez bien le choix de ne supporte

## Browser conditions for bundlers

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))
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.
- 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
- 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

([#8516](https://github.com/sveltejs/svelte/issues/8516))

## Suppression des sorties de build en CJS

Expand Down

0 comments on commit 1457d5b

Please sign in to comment.