Given a package that has exports
in its package.json
, like this:
{
"exports": {
".": "./dist/index.js",
"./*": {
"types": "./dist/*.d.ts",
"default": "./dist/*.js"
}
}
}
When trying to resolve that package, a MODULE_NOT_FOUND
error is thrown with "Cannot find module '/path/to/my-package/dist/package.json.js'"
Basically the assumption here that you can always resolve the package.json
of a package using node does not hold true anymore in this case. Still I'd like to be able to get the root path of that package, using node module resolution rules. π€
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too