-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Support module_resolution: "nodenext"
#8748
Merged
sokra
merged 13 commits into
main
from
mischnic/pack-3031-web-995-support-tsconfig-nodenext
Jul 29, 2024
Merged
Changes from 5 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e098afa
Add nodenext resolution test
mischnic 0962bb7
Support `module_resolution: "nodenext"`
mischnic 61bb5af
Only allow for `.../*.js` specifiers
mischnic 847081e
Cleanup config loading
mischnic 8c02b98
Properly rewrite the pattern
mischnic e37969a
Rename to enable_typescript_with_output_extension
mischnic f07e80c
Fixup Pattern::replace_final_constants
mischnic cad43e7
Merge branch 'main' into mischnic/pack-3031-web-995-support-tsconfig-…
mischnic 51237d2
Replace inside new_path directly
mischnic 874a5ae
Merge branch 'main' into mischnic/pack-3031-web-995-support-tsconfig-…
mischnic bdce7e0
Add more test cases
mischnic 157091c
Merge branch 'main' into mischnic/pack-3031-web-995-support-tsconfig-…
mischnic adfd4d3
Merge branch 'main' into mischnic/pack-3031-web-995-support-tsconfig-…
mischnic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
crates/turbopack-tests/tests/execution/turbopack/resolving/tsconfig-nodenext/input/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import foo from "./src/foo.js"; | ||
|
||
it("should correctly resolve explicit extensions with nodenext", () => { | ||
expect(foo).toBe("foo"); | ||
}); |
1 change: 1 addition & 0 deletions
1
...es/turbopack-tests/tests/execution/turbopack/resolving/tsconfig-nodenext/input/src/foo.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default "foo"; | ||
mischnic marked this conversation as resolved.
Show resolved
Hide resolved
|
6 changes: 6 additions & 0 deletions
6
...turbopack-tests/tests/execution/turbopack/resolving/tsconfig-nodenext/input/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "NodeNext", | ||
"moduleResolution": "NodeNext" | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should modify
new_path
Should be outside of the
if !options_value.fully_specified
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.
One sideeffect of that approach is that is also replaces the
js
that was appended viaextensions
:request with appended extensions:
request with extensions and then the new replacement
But in practice, it probably doesn't make a difference