Skip to content

experimentalExtensionlessBinWorkaround option to resolve extensionless entrypoints to CJS in ESM loader #1611

Closed
@cspotcode

Description

@cspotcode

This is labelled to indicate we will accept a pull request that implements this feature.

Intentionally marked experimental so that ts-node can remove or change it at any time without following semver. Intentionally has verbose name to include the word "workaround."

When a user enables this and they use the ESM loader, it will resolve extensionless entrypoints to CJS format to workaround the errors caused by nodejs/node#33226

This is an intentional divergence from node's behavior. Users who enable this flag must understand that it may cause breakages in the future. However, in the present, it will unblock those users, allowing them to combine ts-node/esm with third-party tools that have extensionless bin entrypoints.

Can be named either experimentalExtensionlessBinWorkaround or experimentalExtensionlessEntrypointWorkaround

See also: discussion starting here
#1007 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    you can do thisGood candidate for a pull request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions