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…
Reference in a new issue