Skip to content

Unable to detect the module format for yargs #5

@Delapouite

Description

@Delapouite

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions