瀏覽代碼

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

Li Kui 6 月之前
父節點
當前提交
6e67fb5fe7
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      docs/.vitepress/config/plugins/demo-preview.ts

+ 4 - 1
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;