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

feat(node-resolve): Resolve js/jsx/mjs/cjs imports from TypeScript files #1498

Merged
merged 1 commit into from May 30, 2023

Conversation

meyfa
Copy link
Contributor

@meyfa meyfa commented May 17, 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

This patch is a combination of PRs #1475 and #1454. It updates the logic for importing from within a TypeScript file. In that case, .js can now resolve to .ts and .tsx, .jsx can resolve to .tsx, .mjs can resolve to .mts, and .cjs can resolve to .cts. This behavior was verified to mimic that of tsc itself. Importing from within plain JS files is untouched (e.g., a .js import from within a .js file will not resolve to .ts).

@tianyingchun
Copy link

it is very import to support tsx, mts,.jsx for pacakge.json type:module declaration

@rollup rollup deleted a comment from tianyingchun May 22, 2023
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.

Thanks for the really quick response, this looks exactly how I hoped it would go!

@tianyingchun
Copy link

how the progress of this feature?

@meyfa
Copy link
Contributor Author

meyfa commented May 30, 2023

@shellscape Since you reviewed #1454, maybe you could take a look at this PR as well?

@NotWoods NotWoods merged commit e9e94b3 into rollup:master May 30, 2023
7 checks passed
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.

None yet

5 participants