Skip to content

Commit

Permalink
fix: respect imports.autoImport: false (#2226)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Mar 7, 2024
1 parent 0e6ba96 commit fef3d59
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
: "",
];
}

Expand Down

0 comments on commit fef3d59

Please sign in to comment.