Skip to content

A new ESM loader equivalent of 'ts-node/register/transpile-only' #1101

Description

@concision

@cspotcode

Continuing the discussion from #1007.


CommonJS has the file shortcut ts-node/register/transpile-only for installing the TypeScript loader without type checking. An ESM loader which has the equivalent functionality should be created and exposed to the end user.

exportconst{resolve, getFormat, transformSource}=esm.registerAndCreateEsmHooks()

The code from esm.mjs can be duplicated in a new file, but with the transpileOnly flag set:

exportconst{resolve, getFormat, transformSource}=esm.registerAndCreateEsmHooks({transpileOnly: true})

What should the loader filename look like? There is ts-node/esm.mjs, should it be ts-node/esm/transpile-only.mjs?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions