Packages

ts-node

10.9.2 · 8 Dec 2023MIT60.2M / weekRepositoryHomepagenpmAtom feed

Your version

10.1.0

9 Jul 2021Where it was published

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 ESM

    • selectively overrides package.json "type" and tsconfig.json "module"

    • akin to .cjs and .mjs extensions, but for .ts and .tsx files

  • Implement "extends" support for "ts-node" options in tsconfig.json (#1328, #1356)

    • "ts-node": {} options will be parsed from extended tsconfigs

    • allows sharing and deduplicating ts-node configuration

  • Un-deprecate scope and scopeDir; add both to CLI and tsconfig.json options; un-deprecate TS_NODE_SCOPE env var; add TS_NODE_SCOPE_DIR env 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 --showConfig output instead of the bottom

Fixed

  • Fix #1282: Set correct globals in [stdin], [eval], and <repl> contexts

    • More closely align ts-node's behavior with vanilla node

    • Affects the interactive REPL, piping to stdin, and ts-node -e

    • Matches node's behavior for globals __filename, __dirname, module and sub-fields of module, exports, and builtin module aliases fs, etc

  • Fix #1343: Set swc option keepClassNames to true

  • #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)

v10.0.0...v10.1.0
github.com/TypeStrong/ts-node/milestone/3