From 1ee568dfb276d6fdffcf207869c554777ce3163d Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 7 Mar 2024 14:17:57 +0000 Subject: [PATCH] fix: respect `imports.autoImport: false` --- src/build.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/build.ts b/src/build.ts index 32f2f4936a..7194bbd9fe 100644 --- a/src/build.ts +++ b/src/build.ts @@ -172,12 +172,14 @@ export async function writeTypes(nitro: Nitro) { } autoImportedTypes = [ - ( - await nitro.unimport.generateTypeDeclarations({ - exportHelper: false, - resolvePath: (i) => resolvedImportPathMap.get(i.from) ?? i.from, - }) - ).trim(), + nitro.options.imports && nitro.options.imports.autoImport !== false + ? ( + await nitro.unimport.generateTypeDeclarations({ + exportHelper: false, + resolvePath: (i) => resolvedImportPathMap.get(i.from) ?? i.from, + }) + ).trim() + : "", ]; }