Skip to content

Commit

Permalink
docs: component preview not showing on Windows (#1401)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jungzl authored Oct 30, 2024
1 parent eb4b1c4 commit adb96cd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/.vitepress/plugins/ComponentPreview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export default function (md: MarkdownRenderer) {
const { realPath, path: _path } = state.env as MarkdownEnv

const childFiles = readdirSync(resolve(dirname(realPath ?? _path), pathName), { withFileTypes: false, recursive: true })
.map(file => typeof file === 'string' ? file.split(/[/\\]/).join('/') : file)

const groupedFiles = childFiles.reduce((prev, curr) => {
if (typeof curr !== 'string')
return prev
Expand Down

0 comments on commit adb96cd

Please sign in to comment.