Skip to content

Commit a26a6af

Browse files
committed
use full path to fetch component
1 parent 31bfaba commit a26a6af

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/parser/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { ComponentMeta } from 'vue-component-meta'
33
import { refineMeta } from "./utils"
44
import { join } from "pathe"
55
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs'
6+
import { withBase } from "ufo"
67

78
export interface Options {
89
rootDir: string
@@ -18,7 +19,7 @@ export function getComponentMeta(component: string, options?: Options): Componen
1819
cacheDir: join(rootDir, ".data/cache"),
1920
...options
2021
}
21-
const fullPath = join(opts.rootDir, component)
22+
const fullPath = withBase(component, opts.rootDir)
2223
const cachePath = join(opts.cacheDir, `${component}.json`)
2324

2425
if (opts.cache && existsSync(cachePath)) {
@@ -35,7 +36,7 @@ export function getComponentMeta(component: string, options?: Options): Componen
3536
},
3637
)
3738

38-
const meta = checker.getComponentMeta(component)
39+
const meta = checker.getComponentMeta(fullPath)
3940
const refinedMeta = refineMeta(meta)
4041

4142
if (opts.cache) {

0 commit comments

Comments
 (0)