Skip to content

Commit 167a7fe

Browse files
authored
Docs merge for 10.8.1 (#1788)
* Update options.md (#1768) * Update options.md * Update options.md * Update configuration.md * Update performance.md * Update transpilers.md
1 parent 599f28b commit 167a7fe

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

website/docs/configuration.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ You can use this sample configuration as a starting point:
2727

2828
```json title="tsconfig.json"
2929
{
30-
// This is an alias to @tsconfig/node12: https://github.com/tsconfig/bases
31-
"extends": "ts-node/node12/tsconfig.json",
30+
// This is an alias to @tsconfig/node16: https://github.com/tsconfig/bases
31+
"extends": "ts-node/node16/tsconfig.json",
3232

3333
// Most ts-node options can be specified here using their programmatic names.
3434
"ts-node": {

website/docs/options.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ ts-node --scope
328328

329329
Scope compiler to files within `scopeDir`. Anything outside this directory is ignored.
330330

331-
*Default: `false` <br/>
331+
*Default:* `false` <br/>
332332
*Environment:* `TS_NODE_SCOPE`
333333

334334
### scopeDir
@@ -374,10 +374,12 @@ Disable top-level await in REPL. Equivalent to node's [`--no-experimental-repl-
374374

375375
Enable experimental hooks that re-map imports and require calls to support:
376376

377-
* resolves `.js` to `.ts`, so that `import "./foo.js"` will execute `foo.ts`
378-
* resolves `.cjs` to `.cts`
379-
* resolves `.mjs` to `.mts`
380-
* allows including file extensions in CommonJS, for consistency with ESM where this is often mandatory
377+
* remapping extensions, e.g. so that `import "./foo.js"` will execute `foo.ts`. Currently the following extensions will be mapped:
378+
* `.js` to `.ts`, `.tsx`, or `.jsx`
379+
* `.cjs` to `.cts`
380+
* `.mjs` to `.mts`
381+
* `.jsx` to `.tsx`
382+
* including file extensions in CommonJS, for consistency with ESM where this is often mandatory
381383

382384
In the future, this hook will also support:
383385

@@ -397,7 +399,7 @@ ts-node --experimentalSpecifierResolution node
397399
```
398400

399401
Like node's [`--experimental-specifier-resolution`](https://nodejs.org/dist/latest-v18.x/docs/api/esm.html#customizing-esm-specifier-resolution-algorithm), but can also be set in your `tsconfig.json` for convenience.
400-
Requires `esm` to be enabled.
402+
Requires [`esm`](#esm) to be enabled.
401403

402404
*Default:* `explicit`<br/>
403405

website/docs/performance.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ These tricks will make ts-node faster.
88

99
It is often better to use `tsc --noEmit` to typecheck as part of your tests or linting. In these cases, ts-node can skip typechecking.
1010

11-
* Enable [swc](./transpilers.md#swc)
11+
* Enable [swc](./swc.md)
1212
* This is by far the fastest option
13-
* Enable [`transpileOnly`](./options.md) to skip typechecking without swc
13+
* Enable [`transpileOnly`](./options.md#transpileonly) to skip typechecking without swc
1414

1515
## With typechecking
1616

website/docs/transpilers.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ sourcemap support, and global ts-node CLI. Plugins automatically derive an appro
1717
The `transpiler` option allows using third-party transpiler plugins with ts-node. `transpiler` must be given the
1818
name of a module which can be `require()`d. The built-in `swc` plugin is exposed as `ts-node/transpilers/swc`.
1919

20-
For example, to use a hypothetical "speedy-ts-compiler", first install it into your project: `npm install speedy-ts-compiler`
20+
For example, to use a hypothetical "@cspotcode/fast-ts-compiler", first install it into your project: `npm install @cspotcode/fast-ts-compiler`
2121

2222
Then add the following to your tsconfig:
2323

2424
```json title="tsconfig.json"
2525
{
2626
"ts-node": {
2727
"transpileOnly": true,
28-
"transpiler": "speedy-ts-compiler"
28+
"transpiler": "@cspotcode/fast-ts-compiler"
2929
}
3030
}
3131
```

0 commit comments

Comments
 (0)