GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Rewrite `.tsx` extension when using `rewriteImportExtensions` by jimmydief · Pull Request #16022 · babel/babel Conversation
Contributor
Include
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/55616/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| : node.exportKind; | ||
| if (kind === "value" && source && /[\\/]/.test(source.value)) { | ||
| source.value = source.value.replace(/(\.[mc]?)ts$/, "$1js"); | ||
| source.value = source.value.replace(/(\.[mc]?)tsx?$/, "$1js"); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Not sure if .mtsx or .ctsx are valid? Seems like no.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yeah they are not valid.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I am a little bit on the fence, since with this PR we would support .tsx but not .jsx. I think we could eventually supports JSX by adding the same option to the react preset if somebody in the future will ask for it (or we could publish extension rewriting as a separate standalone plugin).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
.tsx extension when using rewriteImportExtensions option of TS preset.tsx extension when using rewriteImportExtensions
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
rewriteImportExtensions option for TS preset does not work with .tsx files
There was an error while loading. Please reload this page.