mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
fix(resolver): resolve tsconfig extend that are extensionless (#971)
This commit is contained in:
parent
4ce525c66d
commit
61bc142d95
4 changed files with 9 additions and 3 deletions
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"extends": "tsconfig-field/conf"
|
||||
}
|
||||
|
|
@ -956,7 +956,7 @@ impl<Fs: FileSystem> ResolverGeneric<Fs> {
|
|||
_ => self
|
||||
.clone_with_options(ResolveOptions {
|
||||
description_files: vec![],
|
||||
extensions: vec![],
|
||||
extensions: vec![".json".into()],
|
||||
main_files: vec!["tsconfig.json".into()],
|
||||
..ResolveOptions::default()
|
||||
})
|
||||
|
|
@ -966,7 +966,9 @@ impl<Fs: FileSystem> ResolverGeneric<Fs> {
|
|||
&mut ResolveContext::default(),
|
||||
)
|
||||
.map_err(|err| match err {
|
||||
ResolveError::NotFound(path) => ResolveError::TsconfigNotFound(path),
|
||||
ResolveError::NotFound(_) => ResolveError::TsconfigNotFound(
|
||||
PathBuf::from(tsconfig_extend_specifier),
|
||||
),
|
||||
_ => err,
|
||||
})?
|
||||
.to_path_buf(),
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@ fn tsconfig() {
|
|||
// This requires reading package.json.tsconfig field
|
||||
// (f.join("tsconfig/field"), "foo", f.join("node_modules/tsconfig-field/foo.js"))
|
||||
(f.join("tsconfig/exports"), "foo", f.join("node_modules/tsconfig-exports/foo.js")),
|
||||
(f.join("tsconfig/extends-extension"), "foo", f.join("tsconfig/extends-extension/foo.js"))
|
||||
(f.join("tsconfig/extends-extension"), "foo", f.join("tsconfig/extends-extension/foo.js")),
|
||||
(f.join("tsconfig/extends-extensionless"), "foo", f.join("node_modules/tsconfig-field/foo.js"))
|
||||
];
|
||||
|
||||
for (path, request, expected) in pass {
|
||||
|
|
|
|||
Loading…
Reference in a new issue