-
-
Notifications
You must be signed in to change notification settings - Fork 599
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add hint for missing resolve.extensions when resolving module (#β¦
β¦5680) * feat: add resolve extension fail hint * chore: update resolve message * refactor: give a hint when the relative paths aren't resolved * chore: update test case * fix: comment * fix: clippy warning * fix: clippy
- Loading branch information
Showing
8 changed files
with
143 additions
and
1 deletion.
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
4 changes: 4 additions & 0 deletions
4
packages/rspack/tests/diagnostics/builtins/recoverable_syntax_error/stats.err
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
ERROR in Γ Resolve error: Can't resolve './' in '<PROJECT_ROOT>/tests/diagnostics/builtins/recoverable_syntax_error' | ||
help: Found the module './index.tsx' exists, but its extension is not listed in the `resolve.extensions`. Here are some possible solutions: | ||
|
||
1. add the extension `".tsx"` to `resolve.extensions` in your rspack configuration | ||
2. use './index.tsx' instead of './' |
Empty file.
1 change: 1 addition & 0 deletions
1
packages/rspack/tests/diagnostics/factorize/resolve-extensions-error/err/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 @@ | ||
import a from '../a'; |
3 changes: 3 additions & 0 deletions
3
packages/rspack/tests/diagnostics/factorize/resolve-extensions-error/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,3 @@ | ||
import './err'; | ||
import './test'; | ||
import a from './a'; |
36 changes: 36 additions & 0 deletions
36
packages/rspack/tests/diagnostics/factorize/resolve-extensions-error/stats.err
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,36 @@ | ||
ERROR in ./err/index.js | ||
Γ Resolve error: Can't resolve '../a' in '<PROJECT_ROOT>/tests/diagnostics/factorize/resolve-extensions-error/err' | ||
βββββ | ||
1 β import a from '../a'; | ||
Β· ββββββ | ||
β°ββββ | ||
help: Found the module '../a.txt' exists, but its extension is not listed in the `resolve.extensions`. Here are some possible solutions: | ||
|
||
1. add the extension `".txt"` to `resolve.extensions` in your rspack configuration | ||
2. use '../a.txt' instead of '../a' | ||
|
||
ERROR in ./index.js | ||
Γ Resolve error: Can't resolve './test' in '<PROJECT_ROOT>/tests/diagnostics/factorize/resolve-extensions-error' | ||
ββ[1:1] | ||
1 β import './err'; | ||
2 β import './test'; | ||
Β· ββββββββ | ||
3 β import a from './a'; | ||
β°ββββ | ||
help: Found the module './test/index.txt' exists, but its extension is not listed in the `resolve.extensions`. Here are some possible solutions: | ||
|
||
1. add the extension `".txt"` to `resolve.extensions` in your rspack configuration | ||
2. use './test/index.txt' instead of './test' | ||
|
||
ERROR in ./index.js | ||
Γ Resolve error: Can't resolve './a' in '<PROJECT_ROOT>/tests/diagnostics/factorize/resolve-extensions-error' | ||
ββ[1:1] | ||
1 β import './err'; | ||
2 β import './test'; | ||
3 β import a from './a'; | ||
Β· βββββ | ||
β°ββββ | ||
help: Found the module './a.txt' exists, but its extension is not listed in the `resolve.extensions`. Here are some possible solutions: | ||
|
||
1. add the extension `".txt"` to `resolve.extensions` in your rspack configuration | ||
2. use './a.txt' instead of './a' |
Empty file.
2 changes: 2 additions & 0 deletions
2
packages/rspack/tests/diagnostics/factorize/resolve-extensions-error/webpack.config.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,2 @@ | ||
module.exports = { | ||
} |
d1fe2d1
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.
π Benchmark detail: Open