Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Add support for configurable jsxImportSource when using Emotion SWC #35962

Closed
JohnDaly opened this issue Apr 7, 2022 · 0 comments
Closed

Add support for configurable jsxImportSource when using Emotion SWC #35962

JohnDaly opened this issue Apr 7, 2022 · 0 comments

Comments

@JohnDaly
Copy link
Contributor

JohnDaly commented Apr 7, 2022

Describe the feature you'd like to request

Currently, when opting into the SWC Emotion plugin, there is an assumption made that the jsxImportSource is @emotion/react. This prevents projects that use Emotion 10 from being able to use SWC, because the package which provides the JSX runtime is called @emotion/core.

Describe the solution you'd like

I have a couple suggestions for how to resolve this.

  1. Allow the jsxImportSource from jsConfig.compilerOptions to be used, if present
  2. Allow a jsxImportSource to be specified as part of the emotion SWC options

Of these two suggestions, I think the first one is probably the better way to go, since its a little surprising that the jsxImportSource from jsConfig.compilerOptions is ignored if the nextConfig.experimental.emotion option is set

Describe alternatives you've considered

I'm not aware of another way to set the jsxImportSource to support @emotion/corewhile using the SWC Emotion plugin

@vercel vercel locked and limited conversation to collaborators Apr 7, 2022
@balazsorban44 balazsorban44 converted this issue into discussion #35964 Apr 7, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant