The pkg
option must be set with the package's package.json
.
However this does not work well with ES imports. At the moment, importing JSON files with ES imports is still experimental in Node.js.
Also, hardcoding the path to package.json
can be tricky when transpiling is involved. For example, my binary file is at src/bin.js
, but it is transpiled to build/src/bin.js
. If I want to run both files, I need to dynamically find the path to package.json
with a library like read-pkg-up
.
Adding an option to automatically find the package (with read-pkg-up
for example) would solve this problem. This option would probably need user to pass __dirname
to be able to find the right package.json
.
What do you think?
I can submit a PR if needed.
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