Skip to content

Commit

Permalink
fix: declaration generation not detecting absolute paths on Windows (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
FallDownTheSystem authored Oct 2, 2021
1 parent 8720195 commit 669be0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/declaration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resolve, dirname, relative } from 'path'
import { resolve, dirname, relative, isAbsolute } from 'path'
import { promises as fs, existsSync } from 'fs'
import { notNullish, slash } from '@antfu/utils'
import { Context } from './context'
Expand All @@ -19,7 +19,7 @@ export async function generateDeclaration(ctx: Context, root: string, filepath:
if (!name)
return undefined

const related = slash(path).startsWith('/')
const related = isAbsolute(path)
? `./${relative(dirname(filepath), path)}`
: path

Expand Down

0 comments on commit 669be0b

Please sign in to comment.