fix: remove node resolve condition for preload (#204)

This commit is contained in:
alex8088 2023-07-07 21:35:12 +08:00
parent 785b32f2b0
commit 0367f73a95

View file

@ -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 }