Skip to content

Commit

Permalink
fix: fully resolve internal paths for autoimports (#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Oct 10, 2022
1 parent 7a71b3c commit 4ce9d82
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/build.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { promises as fsp } from 'fs'
import { relative, resolve, join, dirname, isAbsolute } from 'pathe'
import { resolveAlias } from 'pathe/utils'
import * as rollup from 'rollup'
import fse from 'fs-extra'
import { defu } from 'defu'
Expand Down Expand Up @@ -66,7 +67,15 @@ export async function writeTypes (nitro: Nitro) {
if (nitro.unimport) {
autoImportedTypes = [
nitro.unimport
.generateTypeDeclarations({ exportHelper: false })
.generateTypeDeclarations({
exportHelper: false,
resolvePath: (i) => {
if (i.from.startsWith('#internal/nitro')) {
return resolveAlias(i.from, nitro.options.alias)
}
return i.from
}
})
.trim()
]
}
Expand Down

0 comments on commit 4ce9d82

Please sign in to comment.