Browse Source

fix(@vben/docs): build failed on windows (#4362)

pull/4363/head
Li Kui 1 week ago
committed by GitHub
parent
commit
6e67fb5fe7
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 5
      docs/.vitepress/config/plugins/demo-preview.ts

5
docs/.vitepress/config/plugins/demo-preview.ts

@ -47,7 +47,10 @@ export const demoPreviewPlugin = (md: MarkdownRenderer) => {
const regex = /<DemoPreview[^>]*\sdir="([^"]*)"/g;
// Iterate through the Markdown content and replace the pattern
state.src = state.src.replaceAll(regex, (_match, dir) => {
const componentDir = join(process.cwd(), 'src', dir);
const componentDir = join(process.cwd(), 'src', dir).replaceAll(
'\\',
'/',
);
let childFiles: string[] = [];
let dirExists = true;

Loading…
Cancel
Save