Skip to content

Commit f3411cc

Browse files
authored
fix(parser): ensure that filePath is relative to root dir (#49)
1 parent 09d18a4 commit f3411cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fsp from 'fs/promises'
22
import { performance } from 'perf_hooks'
33
import { existsSync } from 'fs'
4-
import { dirname, join } from 'pathe'
4+
import { dirname, join, relative } from 'pathe'
55
import { resolveModule } from '@nuxt/kit'
66
import { createComponentMetaCheckerByJsonConfig } from 'vue-component-meta'
77
import consola from 'consola'
@@ -39,7 +39,7 @@ export function useComponentMetaParser (
3939
acc[component.pascalName] = {
4040
...component,
4141
fullPath: filePath,
42-
filePath: filePath.replace(rootDir, ''),
42+
filePath: relative(rootDir, filePath),
4343
meta: {
4444
props: [],
4545
slots: [],

0 commit comments

Comments
 (0)