Skip to content

Commit adb96cd

Browse files
authored
docs: component preview not showing on Windows (unovue#1401)
1 parent eb4b1c4 commit adb96cd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/.vitepress/plugins/ComponentPreview.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ export default function (md: MarkdownRenderer) {
4949
const { realPath, path: _path } = state.env as MarkdownEnv
5050

5151
const childFiles = readdirSync(resolve(dirname(realPath ?? _path), pathName), { withFileTypes: false, recursive: true })
52+
.map(file => typeof file === 'string' ? file.split(/[/\\]/).join('/') : file)
53+
5254
const groupedFiles = childFiles.reduce((prev, curr) => {
5355
if (typeof curr !== 'string')
5456
return prev

0 commit comments

Comments
 (0)