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

fix(nextjs): fix .babelrc for emotion v11 #6728

Merged
merged 1 commit into from Aug 19, 2021

Conversation

puku0x
Copy link
Contributor

@puku0x puku0x commented Aug 14, 2021

Current Behavior

@nrwl/next generates an application without plugin configuration when --style=@emotion/styled.

Expected Behavior

presets and plugins options should be configured.

{
  "presets": [
    [
      "@nrwl/next/babel",
      {
        "preset-react": {
          "runtime": "automatic",
          "importSource": "@emotion/react"
        }
      }
    ]
  ],
  "plugins": ["@emotion/babel-plugin"]
}

Related Issue(s)

The Next.js official example says users can overwrite the preset options via preset-react.

{
  "presets": [
    [
      "next/babel",
      {
        "preset-react": { // 👈
          "runtime": "automatic",
          "importSource": "@emotion/react"
        }
      }
    ]
  ],
  "plugins": ["@emotion/babel-plugin"]
}

https://github.com/vercel/next.js/blob/077097b7f8d3d826118518a90f27cebd2b1373e6/examples/with-emotion/.babelrc#L1-L14

Closes #6778

@vercel
Copy link

vercel bot commented Aug 14, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nrwl/nx-dev/959iLHHqe8x5Vn1R5TxBVo2g7FN3
✅ Preview: Canceled

@puku0x puku0x marked this pull request as ready for review August 15, 2021 06:01
@jaysoo jaysoo merged commit 0841b55 into nrwl:master Aug 19, 2021
ManojBahuguna pushed a commit to ManojBahuguna/nx that referenced this pull request Sep 16, 2021
@puku0x puku0x deleted the fix-next-babelrc-emotion branch December 7, 2021 15:43
@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 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adjust babel config for nextjs with Emotion
3 participants