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

🐛Babel plugin passed to @vitejs/plugin-react reported as unused #903

Closed
6 tasks done
mbacalan opened this issue Jan 8, 2025 · 2 comments
Closed
6 tasks done
Labels
bug Something isn't working

Comments

@mbacalan
Copy link

mbacalan commented Jan 8, 2025

Prerequisites

Reproduction url

https://github.com/mbacalan/knip-vite-react-emotion-repro

Reproduction access

  • I've made sure the reproduction is publicly accessible

Description of the issue

Plugins can be declared for Babel through @vitejs/plugin-react configuration object in Vite config file.

export default defineConfig({
  plugins: [react({
    babel: {
      plugins: ['@emotion/babel-plugin']
    }
  })],
})

Knip reports these plugins as unused devDependencies:
image

@mbacalan mbacalan added the bug Something isn't working label Jan 8, 2025
@webpro
Copy link
Member

webpro commented Jan 8, 2025

Thanks @mbacalan! Would you be up for a pull request? I'm thinking it comes down to calling the Babel plugin from the Vite plugin if there's a babel object ☎️

@webpro
Copy link
Member

webpro commented Feb 18, 2025

Closing this as #904 was also canceled.

@webpro webpro closed this as not planned Won't fix, can't repro, duplicate, stale Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants