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

support jsxImportSsource @emotion/react? #25

Closed
Dimitri-WEI-Lingfeng opened this issue Dec 14, 2022 · 2 comments
Closed

support jsxImportSsource @emotion/react? #25

Dimitri-WEI-Lingfeng opened this issue Dec 14, 2022 · 2 comments

Comments

@Dimitri-WEI-Lingfeng
Copy link

No description provided.

@dchambers
Copy link

dchambers commented Dec 14, 2022

It just so happens that @sanderdrummer created a branch to do exactly this (as a temporary work-around) just one hour after you created this issue ❤️ . What's even better he also published it to npm as plugin-react-swc-emotion.

Simply switch from @vitejs/plugin-react-swc to plugin-react-swc-emotion in your package.json, and then change the import statement in vite.config.ts to point to plugin-react-swc-emotion, like so:

import { defineConfig } from 'vite'
// TODO: revert to official `@vitejs/plugin-react-swc` once support for configuring `importSource` is added
import react from 'plugin-react-swc-emotion' // @ts-ignore

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
})

@ArnaudBarre
Copy link
Member

Sounds good for me. I will work on this later today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants