Skip to content

fix: ignore __vite-browser-external when trying to resolve svelte packages #363

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 2 commits into from
Jun 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/stupid-melons-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/vite-plugin-svelte': patch
---

Do not try to resolve svelte field in \_\_vite-browser-external, see (#362)"
6 changes: 5 additions & 1 deletion packages/vite-plugin-svelte/src/utils/dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ function isSvelteLib(pkg: Pkg) {

const COMMON_DEPENDENCIES_WITHOUT_SVELTE_FIELD = [
'@lukeed/uuid',
'@playwright/test',
'@sveltejs/vite-plugin-svelte',
'@sveltejs/kit',
'autoprefixer',
Expand All @@ -136,6 +137,7 @@ const COMMON_DEPENDENCIES_WITHOUT_SVELTE_FIELD = [
'eslint',
'jest',
'mdsvex',
'playwright',
'postcss',
'prettier',
'svelte',
Expand All @@ -144,7 +146,9 @@ const COMMON_DEPENDENCIES_WITHOUT_SVELTE_FIELD = [
'svelte-preprocess',
'tslib',
'typescript',
'vite'
'vite',
'vitest',
'__vite-browser-external' // see https://github.com/sveltejs/vite-plugin-svelte/issues/362
];
const COMMON_PREFIXES_WITHOUT_SVELTE_FIELD = [
'@fontsource/',
Expand Down