mirror of
https://github.com/alex8088/electron-vite.git
synced 2025-05-21 20:32:30 +08:00
fix: error occurs when the preload config is a function
This commit is contained in:
parent
e35552b4b6
commit
04abdda294
@ -287,7 +287,7 @@ export async function loadConfigFromFile(
|
||||
if (config.preload) {
|
||||
const preloadViteConfig = config.preload
|
||||
preloadConfig = await (typeof preloadViteConfig === 'function' ? preloadViteConfig(configEnv) : preloadViteConfig)
|
||||
if (!isObject(preloadViteConfig)) {
|
||||
if (!isObject(preloadConfig)) {
|
||||
throw new Error(`preload config must export or return an object`)
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user