diff --git a/packages/e2e-tests/kit-node/__tests__/kit.spec.ts b/packages/e2e-tests/kit-node/__tests__/kit.spec.ts index ba6718949..b291b27c2 100644 --- a/packages/e2e-tests/kit-node/__tests__/kit.spec.ts +++ b/packages/e2e-tests/kit-node/__tests__/kit.spec.ts @@ -344,7 +344,7 @@ describe('kit-node', () => { expectArrayEqual(config.resolve.dedupe, expectedDedupe, `resolve.dedupe in ${filename}`); expectArrayEqual( config.resolve.mainFields, - ['svelte', 'module', 'jsnext:main', 'jsnext'], + ['svelte', 'browser', 'module', 'jsnext:main', 'jsnext'], `resolve.mainFields in ${filename}` ); expectArrayEqual( diff --git a/packages/vite-plugin-svelte/src/utils/constants.js b/packages/vite-plugin-svelte/src/utils/constants.js index 10b47ef00..902dabef7 100644 --- a/packages/vite-plugin-svelte/src/utils/constants.js +++ b/packages/vite-plugin-svelte/src/utils/constants.js @@ -1,6 +1,6 @@ import { isSvelte5 } from './svelte-version.js'; -export const VITE_RESOLVE_MAIN_FIELDS = ['module', 'jsnext:main', 'jsnext']; +export const VITE_RESOLVE_MAIN_FIELDS = ['browser', 'module', 'jsnext:main', 'jsnext']; export const SVELTE_RESOLVE_MAIN_FIELDS = ['svelte'];