Skip to content

Commit

Permalink
fix: add browser to default resolve.mainFields (#809)
Browse files Browse the repository at this point in the history
* fix: add browser to default resolve.mainFields

* chore: fix test

---------

Co-authored-by: bluwy <[email protected]>
  • Loading branch information
WoodyWoodsta and bluwy authored Nov 21, 2023
1 parent c2017e0 commit cdd3b3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/e2e-tests/kit-node/__tests__/kit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin-svelte/src/utils/constants.js
Original file line number Diff line number Diff line change
@@ -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'];

Expand Down

0 comments on commit cdd3b3a

Please sign in to comment.