Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Support MDX2 #380

Closed
wants to merge 2 commits into from
Closed

WIP: Support MDX2 #380

wants to merge 2 commits into from

Conversation

IanVS
Copy link
Member

@IanVS IanVS commented May 17, 2022

This is an alternate approach to #377 that attempts to add support for MDX2 (#234).

This applies a similar approach as vite-plugin-mdx, sending the output of @storybook/mdx2-csf through the @vitejs/plugin-babel transform in order to add react refresh support. This currently blows up because @storybook/mdx2-csf processes the code with babel, which adds its own react-transform. @shilman has indicated that it shouldn't be a problem to add a method or flag that would expose the src without the babel transforms.

},
async transform(src: string, id: string, ssr) {
if (!/\.mdx?$/.test(id)) return src;
const code = await compile(src, { skipCsf: true });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We won't want to skipCsf in the final version, but it avoids some errors for now.

@IanVS
Copy link
Member Author

IanVS commented Jun 28, 2022

Replaced by #377

@IanVS IanVS closed this Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant