File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
packages/cli/doc-plugin-medium-zoom/src Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change
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 下报错
Original file line number Diff line number Diff line change @@ -7,11 +7,14 @@ import type { DocPlugin } from '../../doc-core';
7
7
* The plugin is used to add medium-zoom to the doc site.
8
8
*/
9
9
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, '/' ) ;
11
14
return {
12
15
name : '@modern-js/doc-plugin-medium-zoom' ,
13
16
globalUIComponents : [
14
- path . join ( __dirname , '../src/components/MediumZoom.tsx' ) ,
17
+ path . posix . join ( __dirname , '../src/components/MediumZoom.tsx' ) ,
15
18
] ,
16
19
} ;
17
20
}
You can’t perform that action at this time.
0 commit comments