-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat: support .tsx file as entry #82
feat: support .tsx file as entry #82
Conversation
}), | ||
'tsconfig.json': createTsconfigJson({ | ||
compilerOptions: { | ||
jsx: 'preserve', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this to a different option and assert the output type too?
Currently, preserve
doesn't actually seem to be preserving the JSX and needs to be passed in as a top-level option in esbuild as well:
https://esbuild.github.io/try/#dAAwLjIzLjEAeyBsb2FkZXI6ICdqc3gnLCBqc3g6J3ByZXNlcnZlJywgdHNjb25maWdSYXc6ICd7ICJjb21waWxlck9wdGlvbnMiOiB7ICJqc3giOiAicHJlc2VydmUiIH0gfScgfQBleHBvcnQgY29uc3QgYSA9IDxhPmhpPC9hPg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I set it to react or react-jsx, due to the absence of a type signature for react, a type error will be reported. Can I add @types/react
for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure go ahead, will review again tomorrow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated
44b2487
to
4b18b7f
Compare
Nice work, thanks for the PR! |
🎉 This PR is included in version 2.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The main purpose of this MR is to enable the output files with suffixes such as
.d.ts
,.d.mts
,.d.cts
,.cjs
, and.mjs
to be mapped to.tsx
in the same way as.js
.This modification involves adjusting the file extension mapping in the extensionMap object to establish the appropriate associations. Additionally, several test cases have been updated to ensure the correct functionality and stability when handling these new extensions.
By doing so, the project's flexibility and compatibility are enhanced, allowing for a wider range of file extensions to be processed and mapped to
.tsx
as needed.