fix(kit): don't force config.autoImport in addServerImports (#23472)

This commit is contained in:
Julien Huang 2023-09-29 23:18:52 +02:00 committed by GitHub
parent b95c85b552
commit 9734723aaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,9 +91,8 @@ export function addServerImports (imports: Import[]) {
const nuxt = useNuxt()
nuxt.hook('nitro:config', (config) => {
config.imports = config.imports || {}
config.imports.autoImport = true
if (Array.isArray(config.imports.imports)) {
config.imports.imports = [...config.imports.imports, ...imports]
config.imports.imports.push(...imports)
} else {
config.imports.imports = [config.imports.imports, ...imports]
}