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

feat(storybook): Custom .babelrc in Storybook #10551

Merged
merged 1 commit into from Jun 7, 2022
Merged

feat(storybook): Custom .babelrc in Storybook #10551

merged 1 commit into from Jun 7, 2022

Conversation

veimox
Copy link
Contributor

@veimox veimox commented Jun 1, 2022

Current Behavior

As of now the .babelrc file is mandatory when using @nrwl/react/plugins/storybook. This is due to the .babelrc path is hardcoded to be on the root of the package. This causes #9010 as well as #8032. Furthermore, it fails if the file is not found even though it is not strictly necessary (the code injects optionally some plugins.

Expected Behavior

The .babelrc path is configurable as well as it does not fail if the file is not found

This way we can either avoid having a file or having a file in <package>/.storybook/.babelrc to configure only Storybook and make it more explicit. A side effect is that NextJS projects that have Storybook as well, can now run with swc.

Related Issue(s)

#9010 #8032

Fixes #9010 #8032

@nx-cloud
Copy link

nx-cloud bot commented Jun 1, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit bfc1a84. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 12 targets

Sent with 💌 from NxCloud.

@vercel
Copy link

vercel bot commented Jun 1, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nx-dev ✅ Ready (Inspect) Visit Preview Jun 3, 2022 at 6:40PM (UTC)

@mandarini
Copy link
Member

Hi there @veimox ! Thank you for this fix!!

Can you please:

  1. Fix the failing pipelines
  2. Squash your commits?
    Let me know if you need my help!!

@mandarini mandarini self-assigned this Jun 3, 2022
@mandarini mandarini added the scope: storybook Issues related to Storybook support in Nx label Jun 3, 2022
feat(react): optionally reading from user's options babelrc path

feat(react): silently ignore if webpack plugin cannot find babelrc

docs(storybook): added setting for the custom babelrc
@veimox
Copy link
Contributor Author

veimox commented Jun 3, 2022

All yours @mandarini 😊

@AgentEnder AgentEnder merged commit 52f824c into nrwl:master Jun 7, 2022
@veimox veimox deleted the feat/storybook-custom-babelrc branch June 8, 2022 05:18
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
scope: storybook Issues related to Storybook support in Nx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@nrwl/storybook can't be used in @nrwl/next unless .babelrc added manually (disabling SWC compiler)
3 participants