Skip to content

Commit

Permalink
fix: ignore __vite-browser-external when trying to resolve svelte pac…
Browse files Browse the repository at this point in the history
…kages (#363)

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

* chore: add popular test frameworks to exclusion list for svelte dependency scanning
  • Loading branch information
dominikg committed Jun 5, 2022
1 parent 346f9c1 commit 62b9edf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
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

0 comments on commit 62b9edf

Please sign in to comment.