fix: normalize components:example path to process crawlExample function correctly
This commit is contained in:
parent
993c68e0c6
commit
9fe52b4d86
|
|
@ -1,5 +1,5 @@
|
||||||
import { readFile, readdir } from 'node:fs/promises'
|
import { readFile, readdir } from 'node:fs/promises'
|
||||||
import { join, resolve } from 'pathe'
|
import { join, normalize, resolve } from 'pathe'
|
||||||
import { compileScript, parse } from 'vue/compiler-sfc'
|
import { compileScript, parse } from 'vue/compiler-sfc'
|
||||||
|
|
||||||
import type { Registry } from '../../lib/registry'
|
import type { Registry } from '../../lib/registry'
|
||||||
|
|
@ -66,7 +66,7 @@ async function crawlExample(rootPath: string) {
|
||||||
|
|
||||||
if (dirent.isFile()) {
|
if (dirent.isFile()) {
|
||||||
const [name] = dirent.name.split('.vue')
|
const [name] = dirent.name.split('.vue')
|
||||||
const file_path = join('example', dirent.path.split('/example')[1], dirent.name)
|
const file_path = join('example', normalize(dirent.path).split('/example')[1], dirent.name)
|
||||||
const { dependencies, registryDependencies }
|
const { dependencies, registryDependencies }
|
||||||
= await getDependencies(join(dirent.path, dirent.name))
|
= await getDependencies(join(dirent.path, dirent.name))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user