diff --git a/README.md b/README.md index 85dd06a2..14c0101a 120000 --- a/README.md +++ b/README.md @@ -1 +1 @@ -packages/builder-vite/README.md \ No newline at end of file +packages/builder-vite/README.md diff --git a/examples/react/stories/mdx-in-stories/MarkdownInMDX.stories.mdx b/examples/react/stories/mdx-in-stories/MarkdownInMDX.stories.mdx new file mode 100644 index 00000000..6d06bbbf --- /dev/null +++ b/examples/react/stories/mdx-in-stories/MarkdownInMDX.stories.mdx @@ -0,0 +1,6 @@ +import { Meta } from '@storybook/addon-docs'; +import Test from './Test.md'; + + + + diff --git a/examples/react/stories/mdx-in-stories/Test.md b/examples/react/stories/mdx-in-stories/Test.md new file mode 100644 index 00000000..ea049ec4 --- /dev/null +++ b/examples/react/stories/mdx-in-stories/Test.md @@ -0,0 +1,3 @@ +# Test File + +This is a test for Markdown in MDX. diff --git a/packages/builder-vite/mdx-plugin.ts b/packages/builder-vite/mdx-plugin.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/builder-vite/plugins/mdx-plugin.ts b/packages/builder-vite/plugins/mdx-plugin.ts index 9e61a1a4..7a231fbc 100644 --- a/packages/builder-vite/plugins/mdx-plugin.ts +++ b/packages/builder-vite/plugins/mdx-plugin.ts @@ -50,7 +50,7 @@ export function mdxPlugin(options: Options): Plugin { reactRefresh = reactRefreshPlugins.find((p) => p.transform); }, async transform(code, id, options) { - if (id.endsWith('.mdx')) { + if (id.match(/\.mdx?$/)) { // @ts-ignore const { compile } = features?.previewMdx2 ? await import('@storybook/mdx2-csf')