Skip to content

Commit 482f2bb

Browse files
committed
Update moduleResolution in tsconfig reference
1 parent 2af9258 commit 482f2bb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/tsconfig-reference/copy/en/options/moduleResolution.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ oneline: "Specify how TypeScript looks up a file from a given module specifier."
55

66
Specify the module resolution strategy:
77

8-
- `'node'` for Node.js' CommonJS implementation
9-
- `'node16'` or `'nodenext'` for Node.js' ECMAScript Module Support [from TypeScript 4.7 onwards](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#esm-nodejs)
10-
- `'classic'` used in TypeScript before the release of 1.6. You probably won't need to use `classic` in modern code
8+
- `'node16'` or `'nodenext'` for modern versions of Node.js. Node.js v12 and later supports both ECMAScript imports and CommonJS `require`, which resolve using different algorithms. These `moduleResolution` values, when combined with the corresponding [`module`](#module) values, picks the right algorithm for each resolution based on whether Node.js will see an `import` or `require` in the output JavaScript code.
9+
- `'node10'` (previously called `'node'`) for Node.js versions older than v10, which only support CommonJS `require`. You probably won't need to use `node10` in modern code.
10+
- `'bundler'` for use with bundlers. Like `node16` and `nodenext`, this mode supports package.json `"imports"` and `"exports"`, but unlike the Node.js resolution modes, `bundler` never requires file extensions on relative paths in imports.
11+
- `'classic'` was used in TypeScript before the release of 1.6. `classic` should not be used.
1112

1213
There is a handbook reference page on [Module Resolution](/docs/handbook/module-resolution.html)

0 commit comments

Comments
 (0)