Skip to content

bundle with esbuild fails because yargs/yargs does not have file extension #2014

@cspotcode

Description

@cspotcode

Possible duplicate of #1929 but I'm not sure because that ticket is too vague.

esbuild determines content types based on file extension. esbuild docs

But yargs/yargs does not have a file extension.

This raises an error:

$ echo 'import createYargs from "yargs/yargs";' | yarn esbuild --bundle --loader=js
 > <stdin>:1:24: error: Do not know how to load path: node_modules/yargs/yargs
    1 │ import createYargs from "yargs/yargs";
      ╵                         ~~~~~~~~~~~~~

1 error

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions