Storybook - does not support swc compiler
See original GitHub issueCurrent Behavior
The latest Nx versions introduced the swc compiler as an option.
Currently, adding the "compiler": "swc"
to the project.json
file under storybook
configuration fails because babel
remains in webpack loaders.
Expected Behavior
Storybook should support swc compiler
Steps to Reproduce
- Create a React app
- Add Storybook configuration
- Add
"compiler": "swc"
under the project’sstorybook
configuration ->options
- Run storybook
Issue Analytics
- State:
- Created 2 years ago
- Reactions:15
- Comments:18 (10 by maintainers)
Top Results From Across the Web
Speed up Storybook with Vite and SWC — with the help of Nx
Vite is a build tool that ensures faster load times, faster updates, ... Storybook supports SWC using the storybook-addon-swc addon.
Read more >SWC Addon | Storybook: Frontend workshop for UI development
This builder changes the build system of Storybook from Webpack to Vite. Vite is very fast because it does not bundle during development....
Read more >storybook-addon-swc - npm
Start using storybook-addon-swc in your project by running `npm i storybook-addon-swc`. There are no other projects in the npm registry ...
Read more >@nrwl/js:swc | Nx
Builds using SWC. Options can be configured in project.json when defining the executor, or when invoking it. Read more about how to configure...
Read more >How to use babel-emotion-plugin with Storybook + Typescript?
I don't know if might solve your issue, but i got mine by just using this configuration in .storybook/main.js :
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
Ahhh I see what you’re saying! 😃 Well, the thing is that we want to keep the experience as close to the native Storybook as possible, to avoid any glitches and loose ends that may appear in the long run. So I think it makes sense to install the package that Storybook suggests.
On another note, however, I think that we could add the compiler option to the
storybook
target, for non-buildable libs that do not have a compiler already chosen, since they do not have abuild
target.@mandarini should the storybook support
"compiler": "swc"
configuration like apps/libs? If so, that still doesn’t seem to work