question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Storybook - does not support swc compiler

See original GitHub issue

Current 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’s storybook configuration -> options
  • Run storybook

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:15
  • Comments:18 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
mandarinicommented, Jun 21, 2022

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 a build target.

1reaction
danr-zacommented, Jun 11, 2022

@mandarini should the storybook support "compiler": "swc" configuration like apps/libs? If so, that still doesn’t seem to work

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found