ts-node
10.9.2 · 8 Dec 2023MIT60.2M / weekRepositoryHomepagenpmAtom feed
10.9.2 is the newest release of 10.x.
In short
2 new3 fixed4 changed
Release note
Questions about this release? Ask in the official discussion thread
Added
Add
"moduleType"option to override module type -- CommonJS or ECMAScript -- on select files. (docs) (#1342, #1371, #1376)Useful when a configuration file, for example
webpack.config.ts, must execute as CommonJS but the rest of the project is ESMselectively overrides
package.json"type"andtsconfig.json"module"akin to
.cjsand.mjsextensions, but for.tsand.tsxfiles
Implement
"extends"support for"ts-node"options intsconfig.json(#1328, #1356)"ts-node": {}options will be parsed from extended tsconfigsallows sharing and deduplicating ts-node configuration
Un-deprecate
scopeandscopeDir; add both to CLI andtsconfig.jsonoptions; un-deprecateTS_NODE_SCOPEenv var; addTS_NODE_SCOPE_DIRenv var (docs) (#1346, #1367)
Changed
Improve error messages thrown by native ESM loader hooks (#1357, #1373)
messages more closely match node; are more descriptive
Emit
"ts-node"object at the top of--showConfigoutput instead of the bottom
Fixed
Fix #1282: Set correct globals in
[stdin],[eval], and<repl>contextsMore closely align ts-node's behavior with vanilla node
Affects the interactive REPL, piping to stdin, and
ts-node -eMatches node's behavior for globals
__filename,__dirname,moduleand sub-fields ofmodule,exports, and builtin module aliasesfs, etc
Fix #1343: Set swc option
keepClassNamestotrue#1387: REPL outputs 'use strict' after first empty line of input
Docs
Update ESM docs to say that env vars are supported with
node --loader ts-node/esm(docs)