Skip to content

Subpath patterns are not supported #2569

Description

@sybereal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions