Skip to content

Commit 0a86b31

Browse files
authored
fix: e2e error (#3726)
1 parent c90ea5a commit 0a86b31

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.changeset/quiet-geese-rescue.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@modern-js/doc-plugin-medium-zoom': patch
3+
---
4+
5+
fix(doc-tools): medium-zoom plugin error in windows
6+
7+
fix(doc-tools): medium-zoom 插件在 windows 下报错

packages/cli/doc-plugin-medium-zoom/src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ import type { DocPlugin } from '../../doc-core';
77
* The plugin is used to add medium-zoom to the doc site.
88
*/
99
export function pluginMediumZoom(): DocPlugin {
10-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
10+
const __dirname = path
11+
.dirname(fileURLToPath(import.meta.url))
12+
// Fix: adapt windows
13+
.replace(/\\/g, '/');
1114
return {
1215
name: '@modern-js/doc-plugin-medium-zoom',
1316
globalUIComponents: [
14-
path.join(__dirname, '../src/components/MediumZoom.tsx'),
17+
path.posix.join(__dirname, '../src/components/MediumZoom.tsx'),
1518
],
1619
};
1720
}

0 commit comments

Comments
 (0)