Skip to content

Commit

Permalink
chore: compatible vite@4 resolve node first
Browse files Browse the repository at this point in the history
  • Loading branch information
caoxiemeihao committed Apr 21, 2024
1 parent a16fe3c commit 96905d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export function resolveViteConfig(options: ElectronOptions): InlineConfig {
emptyOutDir: false,
},
resolve: {
// @ts-ignore
browserField: false,
conditions: ['node'],
// #98
// Since we're building for electron (which uses Node.js), we don't want to use the "browser" field in the packages.
// It corrupts bundling packages like `ws` and `isomorphic-ws`, for example.
Expand Down

0 comments on commit 96905d9

Please sign in to comment.