Hello
My initial attempt was to try npx is-esm yargs. It was my first reflex because I knew that this library had made the transition to ESM as detailed in their blog post from 2020: https://yargs.js.org/2020/09/07/yargs-16.html
Unfortunately it failed with a Unable to detect the module format. As the caught error is silenced, I don't know yet what's happening.
By inspecting the package.json of yargs, we can get a few clues that ESM is supported because there's an exports object with definition pointing to .mjs file. https://github.com/yargs/yargs/blob/main/package.json
So maybe is-esm could fallback on this kind of heuristics in case the rollup method does not work as intended?
Thanks!
Hello
My initial attempt was to try
npx is-esm yargs. It was my first reflex because I knew that this library had made the transition to ESM as detailed in their blog post from 2020: https://yargs.js.org/2020/09/07/yargs-16.htmlUnfortunately it failed with a
Unable to detect the module format. As the caught error is silenced, I don't know yet what's happening.By inspecting the package.json of
yargs, we can get a few clues that ESM is supported because there's anexportsobject with definition pointing to.mjsfile. https://github.com/yargs/yargs/blob/main/package.jsonSo maybe
is-esmcould fallback on this kind of heuristics in case therollupmethod does not work as intended?Thanks!