-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(trace): resolve incorrect extension (#9486)
### Description Invalid extensions are unfortunately too common in imports. Therefore if we can't resolve with the extension, we strip it and try again. ### Testing Instructions Added a test where we try to import with the wrong extension
- Loading branch information
1 parent
b6ddde3
commit 0a2ef17
Showing
4 changed files
with
50 additions
and
7 deletions.
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
20 changes: 20 additions & 0 deletions
20
...hots/query__turbo_trace_get_`incorrect_extension.mjs`_with_dependencies_([email protected]).snap
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,20 @@ | ||
--- | ||
source: crates/turborepo/tests/query.rs | ||
expression: query_output | ||
--- | ||
{ | ||
"data": { | ||
"file": { | ||
"path": "incorrect_extension.mjs", | ||
"dependencies": { | ||
"files": { | ||
"items": [ | ||
{ | ||
"path": "bar.js" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
turborepo-tests/integration/fixtures/turbo_trace/incorrect_extension.mjs
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 @@ | ||
import { bar } from "./bar.cjs"; |