Skip to content

fix(node-resolve): Resolve all combinations of .ts/.tsx imported as .js#1475

Closed
meyfa wants to merge 1 commit intorollup:masterfrom
meyfa:fix/issue-1465
Closed

fix(node-resolve): Resolve all combinations of .ts/.tsx imported as .js#1475
meyfa wants to merge 1 commit intorollup:masterfrom
meyfa:fix/issue-1465

Conversation

@meyfa
Copy link
Contributor

@meyfa meyfa commented Apr 5, 2023

Rollup Plugin Name: node-resolve

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers: #1465

Description

When importing a file ending in .js from a TypeScript file (extension .ts or .tsx), this should resolve to both .ts
or .tsx. Before this patch, .tsx would only be resolved when the importing file was itself a .tsx, and the same for .ts. This behavior was contrary to the existing comment above the check.

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@lukastaegert
Copy link
Member

@meyfa As we did not hear back from #1454, would you be willing to create a generalized version of this PR that also handles .mts and .cts correctly? This should not block this PR from being merged, though.

@meyfa
Copy link
Contributor Author

meyfa commented May 17, 2023

@lukastaegert Done! See #1498

@meyfa
Copy link
Contributor Author

meyfa commented May 30, 2023

Closing this, since #1498 was merged 🎉

@meyfa meyfa closed this May 30, 2023
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.

2 participants