-
-
Notifications
You must be signed in to change notification settings - Fork 115
feat: enable prebundling by default #494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
6b68fd7
feat: enable prebundleSvelteLibraries by default
dominikg d667f0a
docs: add information about switching from deep imports to package im…
dominikg d91aa55
docs: update prebundling faq
dominikg c935cec
docs: update changeset to remove outdated advice
dominikg fff972b
docs: Apply suggestions from code review
dominikg c43423b
docs: improve recommendations
dominikg eccc491
fix: make sure prebundleSvelteLibraries is not used for build or ssr
dominikg b1a8aff
docs: Apply suggestions from code review
dominikg 79b817b
Merge branch 'main' into feat/enable-prebundling-by-default
dominikg 3ef1c80
docs: Apply suggestions from code review
dominikg df16170
docs: update follow-up wording after previous changes
dominikg 4413ff4
fix: only enable prebundleSvelteLibraries for dev, log warnings if it…
dominikg 076a8ad
docs: update default value in docs
dominikg 84c055a
Merge branch 'main' into feat/enable-prebundling-by-default
dominikg 1c657b1
fix: remove warning for ssr.optimizeDeps, we don't add the svelte esb…
dominikg 06b9de4
Apply suggestions from code review
dominikg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,7 @@ | ||
--- | ||
'@sveltejs/vite-plugin-svelte': minor | ||
--- | ||
|
||
enable `prebundleSvelteLibraries` by default to improve page loading for the dev server. | ||
|
||
see the [FAQ](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#what-is-going-on-with-vite-and-pre-bundling-dependencies) for more information about `prebundleSvelteLibraries` and how to tune it. |
This file contains hidden or 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 hidden or 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
15 changes: 1 addition & 14 deletions
15
packages/e2e-tests/package-json-svelte-field/__tests__/package-json-svelte-field.spec.ts
This file contains hidden or 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 |
---|---|---|
@@ -1,18 +1,5 @@ | ||
import { getText, isBuild, readVitePrebundleMetadata } from '~utils'; | ||
import { getText } from '~utils'; | ||
|
||
test('should render component imported via svelte field in package.json', async () => { | ||
expect(await getText('#test-id')).toBe('svelte field works'); | ||
}); | ||
|
||
if (!isBuild) { | ||
test('should optimize nested cjs deps of excluded svelte deps', () => { | ||
const metadataFile = readVitePrebundleMetadata(); | ||
const metadata = JSON.parse(metadataFile); | ||
const optimizedPaths = Object.keys(metadata.optimized); | ||
expect(optimizedPaths).not.toContain('e2e-test-dep-svelte-nested'); | ||
expect(optimizedPaths).not.toContain('e2e-test-dep-svelte-simple'); | ||
expect(optimizedPaths).toContain( | ||
'e2e-test-dep-svelte-nested > e2e-test-dep-svelte-simple > e2e-test-dep-cjs-only' | ||
); | ||
}); | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.