tsc-multi icon indicating copy to clipboard operation
tsc-multi copied to clipboard

Feature Request: module: Node16 support

Open jason-ha opened this issue 1 year ago • 0 comments

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.

jason-ha avatar Feb 09 '24 22:02 jason-ha