From 0367f73a954d718414806eaa94639dc280cb4c60 Mon Sep 17 00:00:00 2001 From: alex8088 <244096523@qq.com> Date: Fri, 7 Jul 2023 21:35:12 +0800 Subject: [PATCH] fix: remove node resolve condition for preload (#204) --- src/plugins/electron.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/plugins/electron.ts b/src/plugins/electron.ts index 73dfe1f..b5accf0 100644 --- a/src/plugins/electron.ts +++ b/src/plugins/electron.ts @@ -158,11 +158,6 @@ export function electronPreloadVitePlugin(options?: ElectronPluginOptions): Plug const nodeTarget = getElectronNodeTarget() const defaultConfig = { - resolve: { - browserField: false, - mainFields: ['module', 'jsnext:main', 'jsnext'], - conditions: ['node'] - }, build: { outDir: path.resolve(root, 'out', 'preload'), target: nodeTarget, @@ -197,8 +192,6 @@ export function electronPreloadVitePlugin(options?: ElectronPluginOptions): Plug const buildConfig = mergeConfig(defaultConfig.build, build) config.build = buildConfig - config.resolve = mergeConfig(defaultConfig.resolve, config.resolve || {}) - config.define = config.define || {} config.define = { ...processEnvDefine(), ...config.define }