Use babelrc config in stories.mdx files
See original GitHub issueDescribe the bug
We use twin.macro in our stories.mdx
file. Since Storybook 6.0 this macro no longer applies correctly. The reason for this seems to be that the stories.mdx
loader in the webpack config disables babelrc
. Why was this setting disabled, and is it safe to enable the babelrc
config again?
Code snippets
This is the (simplified) loader config for stories.mdx
files:
{
"test": "/(stories|story).mdx/",
"use": [
{
"loader": "babel-loader/lib/index.js",
"options": {
"babelrc": false,
"configFile": false
}
}
]
}
Additional context
See related issue on the twin.macro
repository.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Configure Storybook
Storybook is configured via a folder called .storybook , which contains various configuration files. Note that you can change the folder that Storybook...
Read more >storybook/addon-docs - npm
The configureJSX option is useful when you're writing your docs in MDX and your project's babel config isn't already set up to handle...
Read more >Getting started - MDX
This article explains how to integrate MDX into your project. It shows how to use MDX with your bundler and JSX runtime of...
Read more >Storybook mdx files are not displayed - Stack Overflow
I use default Storybook Webpack config alongside with data from my existed one. I don't see any *.mdx files in a stories side-bar....
Read more >Configuring Storybook: 6 Tips You Can't Miss | by Zheng Li
The configuration files are located in your project root fold ... js|mdx)'],// addons added to your storybook ... custom babel config
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes that works, thanks!
¡Ay Caramba!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.17 containing PR #12211 that references this issue. Upgrade today to try it out!