Subpath patterns, as documented here, allow specifying patterns of files that can be imported in other packages. This is especially useful for packaging TypeScript. The exports object could look like this, for example:
{
"./*.js": {
"types": "out/*.d.ts",
"import": "out/*.js"
}
}
If I import foo/bar.js in a package depending on this one, TypeScript will correctly look up the type information in out/bar.d.ts. esbuild, however, fails to resolve the import and exits with a message along the lines of "foo/bar.js" is not exported.
I've created a hopefully understandable minimal reproduction of this issue at https://github.com/sybereal/esbuild-export-pattern-repro.
Subpath patterns, as documented here, allow specifying patterns of files that can be imported in other packages. This is especially useful for packaging TypeScript. The exports object could look like this, for example:
{ "./*.js": { "types": "out/*.d.ts", "import": "out/*.js" } }If I import
foo/bar.jsin a package depending on this one, TypeScript will correctly look up the type information inout/bar.d.ts. esbuild, however, fails to resolve the import and exits with a message along the lines of"foo/bar.js" is not exported.I've created a hopefully understandable minimal reproduction of this issue at https://github.com/sybereal/esbuild-export-pattern-repro.