Skip to content

Commit

Permalink
chore: try fix windows
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed May 24, 2022
1 parent ed8a727 commit 4c7d643
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/ctx.ts
Expand Up @@ -59,11 +59,11 @@ export function createContext(options: Options = {}, root = process.cwd()) {
: resolve(root, preferDTS)

function generateDTS(file: string) {
const dir = slash(dirname(file))
const dir = dirname(file)
return unimport.generateTypeDecarations({
resolvePath: (i) => {
if (i.from.startsWith('.') || i.from.startsWith('/')) {
const related = slash(relative(dir, slash(i.from)).replace(/\.ts$/, ''))
const related = slash(relative(dir, i.from).replace(/\.ts$/, ''))
return !related.startsWith('.')
? `./${related}`
: related
Expand Down

0 comments on commit 4c7d643

Please sign in to comment.