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

Docs merge for 10.8.2 release #1823

Merged
merged 6 commits into from
Jul 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions website/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ You can use this sample configuration as a starting point:

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

// Most ts-node options can be specified here using their programmatic names.
"ts-node": {
Expand Down
14 changes: 8 additions & 6 deletions website/docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ ts-node --scope

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

*Default: `false` <br/>
*Default:* `false` <br/>
*Environment:* `TS_NODE_SCOPE`

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

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

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

In the future, this hook will also support:

Expand All @@ -397,7 +399,7 @@ ts-node --experimentalSpecifierResolution node
```

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.
Requires `esm` to be enabled.
Requires [`esm`](#esm) to be enabled.

*Default:* `explicit`<br/>

Expand Down
4 changes: 2 additions & 2 deletions website/docs/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ These tricks will make ts-node faster.

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.

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

## With typechecking

Expand Down
4 changes: 2 additions & 2 deletions website/docs/transpilers.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ sourcemap support, and global ts-node CLI. Plugins automatically derive an appro
The `transpiler` option allows using third-party transpiler plugins with ts-node. `transpiler` must be given the
name of a module which can be `require()`d. The built-in `swc` plugin is exposed as `ts-node/transpilers/swc`.

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

Then add the following to your tsconfig:

```json title="tsconfig.json"
{
"ts-node": {
"transpileOnly": true,
"transpiler": "speedy-ts-compiler"
"transpiler": "@cspotcode/fast-ts-compiler"
}
}
```
Expand Down