Skip to content

Commit 62b9edf

Browse files
authored
fix: ignore __vite-browser-external when trying to resolve svelte packages (#363)
* fix: ignore __vite-browser-external when trying to resolve svelte packages * chore: add popular test frameworks to exclusion list for svelte dependency scanning
1 parent 346f9c1 commit 62b9edf

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/stupid-melons-try.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/vite-plugin-svelte': patch
3+
---
4+
5+
Do not try to resolve svelte field in \_\_vite-browser-external, see (#362)"

packages/vite-plugin-svelte/src/utils/dependencies.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ function isSvelteLib(pkg: Pkg) {
127127

128128
const COMMON_DEPENDENCIES_WITHOUT_SVELTE_FIELD = [
129129
'@lukeed/uuid',
130+
'@playwright/test',
130131
'@sveltejs/vite-plugin-svelte',
131132
'@sveltejs/kit',
132133
'autoprefixer',
@@ -136,6 +137,7 @@ const COMMON_DEPENDENCIES_WITHOUT_SVELTE_FIELD = [
136137
'eslint',
137138
'jest',
138139
'mdsvex',
140+
'playwright',
139141
'postcss',
140142
'prettier',
141143
'svelte',
@@ -144,7 +146,9 @@ const COMMON_DEPENDENCIES_WITHOUT_SVELTE_FIELD = [
144146
'svelte-preprocess',
145147
'tslib',
146148
'typescript',
147-
'vite'
149+
'vite',
150+
'vitest',
151+
'__vite-browser-external' // see https://github.com/sveltejs/vite-plugin-svelte/issues/362
148152
];
149153
const COMMON_PREFIXES_WITHOUT_SVELTE_FIELD = [
150154
'@fontsource/',

0 commit comments

Comments
 (0)