Skip to content

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

Closed
@concision

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.

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

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

export const {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?

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