Skip to content

Commit

Permalink
fix: respect imports.autoImport: false
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Mar 7, 2024
1 parent 928373c commit 1ee568d
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 1ee568d

Please sign in to comment.