sindresorhus / meow

🐈 CLI app helper
MIT License
3.54k stars 151 forks source link

Cannot use v10 in CommonJS projects #184

Closed disintegrator closed 3 years ago

disintegrator commented 3 years ago

I'm not sure if this was intentional but v10 made the importMeta option required and expects it to be import.meta. The project I'm working is still using cjs and as a result breaks when upgrading to v10. I've seen an instance where someone mocks import.meta to make things work [1] but I'd rather check here first about alternatives before going down that path.

[1]: importMeta: { url: pathToFileURL(__filename).href }

sindresorhus commented 3 years ago

It's very much intentional. Please read the release notes: https://github.com/sindresorhus/meow/releases/tag/v10.0.0

In particular: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c