Skip to content

Feature Request: module: Node16 support #23

@jason-ha

Description

@jason-ha

With module: Node16 the type property of package.json determines how .js files are interpreted.
"type": "module" -> ESM
"type": "commonjs" or not present -> CommonJS

tsc only enters full ESM mode when Node16 is used and package.json has "type": "module". This includes verification of full extensions specification in import paths.

tsc-multi can hook the reading of package.json files to enable dual emit without the need to fix up imports are tsc will do all of the work. So long as outDir are distinct users may dual support by also placing appropriate package.json in the outDir.

Additionally Node16 CommonJs emits slightly differently and tsc-multi should have test coverage for that.

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