Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: module: Node16 support #23

Open
jason-ha opened this issue Feb 9, 2024 · 0 comments
Open

Feature Request: module: Node16 support #23

jason-ha opened this issue Feb 9, 2024 · 0 comments

Comments

@jason-ha
Copy link

jason-ha commented Feb 9, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant