Closed LitoMore closed 3 years ago
We can resolve #125 at the same time.
Yeah. PR welcome to move meow
to ESM.
See:
I'm going to use this code below to instead CommonJS module's __filename
:
import {fileURLToPath} from 'url';
const __filename = fileURLToPath(import.meta.url);
This is not fixed until we add back support for the package.json reading.
I tested this issue on the main
branch and looks good.
Is there any edge case that will cause the read package issue?
I'm not sure what you're asking. You removed the old workaround for clearing the require cache. We now need to allow the user to pass in import.meta
somehow to be able to know the meow consumer's CWD.
Oh, I see. Let me continue on this work.
meow
is usingmodule.parent.filename
asparentDir
to read package info:But in ESM, we cannot use
__filename
anymore.Do you have any plan move this package to ESM?
@sindresorhus And I wonder how you would solve this problem?