Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subpath patterns are not supported #2569

Closed
sybereal opened this issue Sep 23, 2022 · 2 comments
Closed

Subpath patterns are not supported #2569

sybereal opened this issue Sep 23, 2022 · 2 comments

Comments

@sybereal
Copy link

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.

@evanw
Copy link
Owner

evanw commented Sep 23, 2022

I think this issue is a request for this feature: nodejs/node#39635. That PR changed node's path resolution algorithm after esbuild implemented it, and esbuild's implementation now needs to be updated.

@evanw evanw closed this as completed in efd0af6 Sep 23, 2022
@sybereal
Copy link
Author

Thank you for the amazingly quick resolution, much appreciated. esbuild has been a pleasure to work with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants