-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve deduplication support for svelte during dev (#137)
* fix: improve deduplication support by adding svelte itself to optimizeDeps.include by default * docs: improve changeset description
- Loading branch information
Showing
3 changed files
with
46 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
'@sveltejs/vite-plugin-svelte': major | ||
--- | ||
|
||
automatically include svelte in vite config optimizeDeps.include | ||
|
||
Previously, svelte was automatically excluded. We include it now by default to improve deduplication. | ||
|
||
As a result, svelte is pre-bundled by vite during dev, which it logs when starting the devserver | ||
|
||
```shell | ||
Pre-bundling dependencies: | ||
svelte/animate | ||
svelte/easing | ||
svelte/internal | ||
svelte/motion | ||
svelte/store | ||
(...and 2 more) | ||
(this will be run only when your dependencies or config have changed) | ||
``` | ||
|
||
And it's also visible in the browsers network tab, where requests for svelte imports now start with `node_modules/.vite/` during dev. | ||
|
||
Check out the [vite pre-bundling documentation](https://vitejs.dev/guide/dep-pre-bundling.html) for more information. | ||
|
||
To get the old behavior back, add the following to your vite config | ||
|
||
```js | ||
optimizeDeps: { | ||
exclude: ['svelte']; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters