Support exports with star globs

This commit is contained in:
Asger F
2025-04-07 14:37:14 +02:00
parent a835aec81b
commit f13e8c517f
5 changed files with 78 additions and 20 deletions

View File

@@ -8,3 +8,6 @@ import '@example/package-with-exports'; // $ importTarget=PackageWithExports/mai
import '../PackageWithExports/fake-file'; // Not a valid import
import '@example/package-with-exports/fake-file'; // $ importTarget=PackageWithExports/fake-file-impl.js
import '../PackageWithExports/star/foo'; // Not a valid import
import '@example/package-with-exports/star/foo'; // $ importTarget=PackageWithExports/star-impl/foo.js

View File

@@ -6,6 +6,9 @@
},
"./fake-file": {
"default": "./fake-file-impl.js"
},
"./star/*": {
"default": "./star-impl/*"
}
}
}

View File

@@ -0,0 +1 @@
export const x = 1;

View File

@@ -29,6 +29,7 @@
| Basic/import-packages.ts:6:1:6:43 | import ... -main'; | PackageWithModuleMain/main.js |
| Basic/import-packages.ts:7:1:7:39 | import ... ports'; | PackageWithExports/main.js |
| Basic/import-packages.ts:10:1:10:49 | import ... -file'; | PackageWithExports/fake-file-impl.js |
| Basic/import-packages.ts:13:1:13:48 | import ... r/foo'; | PackageWithExports/star-impl/foo.js |
| Basic/index.ts:1:1:1:22 | import ... r/sub'; | Basic/Subdir/sub.ts |
| Extended/src/main.ts:2:1:2:21 | import ... /file"; | Extended/lib/file.ts |
| Extended/src/main.ts:3:1:3:24 | import ... le.ts"; | Extended/lib/file.ts |