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 JSX Options Being Ignored In Babel Transpiling #862

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

BeeeQueue
Copy link

@BeeeQueue BeeeQueue commented Apr 24, 2023

Summary

An improvement of #748, this PR fixes the issue that the JSX transform options are not used when using babel to transpile the output. The old PR added a duplicate option for it, this one reuses the existing JSX options.

It's really ugly and duplicates a bunch of code, but I wasn't sure where to put the shared code so I'll let you edit it to whatever you want.

I also updated the resolvePlugin function to handle modules that don't just export a single default export.

Test plan

I ran this command after linking the built packages to my repo:

pnpm build; open dist/.../large.svg.js | str contains "React.createElement"

and got the response false.

fixes #801

@vercel
Copy link

vercel bot commented Apr 24, 2023

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

Name Status Preview Comments Updated (UTC)
svgr ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2023 4:07pm

@gregberge
Copy link
Owner

Thanks @BeeeQueue, could you please fix the tests?

@stale
Copy link

stale bot commented Aug 12, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

Successfully merging this pull request may close these issues.

jsxRuntimeImport not getting picked up?
2 participants