Skip to content

fix: default moduleResolution for module: preserve #90

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

Merged

Conversation

sxzz
Copy link
Contributor

@sxzz sxzz commented May 16, 2025

  • When target is set to es2022 and module is preserve, the default value of moduleResolution should be bundler.
  • In fact, the default value of moduleResolution depends only on the module setting, not on target.

Downstream rolldown/tsdown#235

@@ -291,7 +291,6 @@ const normalizeCompilerOptions = (

if (target === 'esnext') {
compilerOptions.module ??= 'es6';
Copy link
Contributor Author

@sxzz sxzz May 16, 2025

Choose a reason for hiding this comment

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

We've set the default value for module here, and the default value for moduleResolution will be set after line 321.
https://github.com/sxzz/get-tsconfig/blob/ef1aad00c28d4ba6b8494204f468b510567e433c/src/parse-tsconfig/index.ts#L363-L376

@privatenumber privatenumber changed the title fix: default moduleResolution fix: default moduleResolution for module: preserve May 20, 2025
@privatenumber privatenumber merged commit 8564f88 into privatenumber:master May 20, 2025
2 of 3 checks passed
@privatenumber
Copy link
Owner

Thank you!

@privatenumber
Copy link
Owner

🎉 This PR is included in version 4.10.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sxzz sxzz deleted the fix/default-module-resolution branch May 21, 2025 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants