File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
packages/builder-vite/plugins Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { dirname } from 'node:path' ;
2
2
import type { Options } from '@storybook/core-common' ;
3
3
import { Plugin } from 'vite' ;
4
+ import slash from 'slash' ;
4
5
5
6
const isStorybookMdx = ( id : string ) => id . endsWith ( 'stories.mdx' ) || id . endsWith ( 'story.mdx' ) ;
6
7
@@ -10,10 +11,12 @@ const isStorybookMdx = (id: string) => id.endsWith('stories.mdx') || id.endsWith
10
11
* Equivilent to https://github.com/storybookjs/mdx1-csf/blob/d58cb032a8902b3f24ad487b6a7aae11ba8b33f6/loader.js#L12-L16
11
12
*/
12
13
function injectRenderer ( code : string ) {
13
- const mdxReactPackage = dirname (
14
- require . resolve ( '@mdx-js/react/package.json' , {
15
- paths : [ dirname ( require . resolve ( '@storybook/mdx1-csf/package.json' ) ) ] ,
16
- } )
14
+ const mdxReactPackage = slash (
15
+ dirname (
16
+ require . resolve ( '@mdx-js/react/package.json' , {
17
+ paths : [ dirname ( require . resolve ( '@storybook/mdx1-csf/package.json' ) ) ] ,
18
+ } )
19
+ )
17
20
) ;
18
21
19
22
return `
You can’t perform that action at this time.
0 commit comments