Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Node Target Mapping

翠 edited this pageMay 13, 2025 ·15 revisions

Recommended Node TSConfig settings

You can let TypeScript compile as little as possible by knowing what the baseline supportfor ECMAScript features are available in your node version

You can also usehttps://github.com/tsconfig/bases/ to findtsconfig.jsons to extend, simplifying your own JSON files to just the options for your project.

To update this file, you can usenode.green to map to the different options inmicrosoft/typescript@src/lib

Node 24

{"compilerOptions": {"lib": ["ES2024"],"module":"nodenext","target":"ES2024"  }}

Note:module is set tonodenext to allowrequire("esm"). After TypeScript 5.9 is released, it is recommended to set it tonode20 instead.

Node 22

{"compilerOptions": {"lib": ["ES2023"],"module":"nodenext","target":"ES2023"  }}

Note:module is set tonodenext to allowrequire("esm"). After TypeScript 5.9 is released, it is recommended to set it tonode20 instead.

Node 20

{"compilerOptions": {"lib": ["ES2023"],"module":"nodenext","target":"ES2023"  }}

Note:module is set tonodenext to allowrequire("esm"). After TypeScript 5.9 is released, it is recommended to set it tonode20 instead.

Node 18

{"compilerOptions": {"lib": ["ES2022"],"module":"node16","target":"ES2022"  }}

Node 16

{"compilerOptions": {"lib": ["ES2021"],"module":"node16","target":"ES2021"  }}

Note: Due to a V8 bug, one rarely-used ES2020 feature was incorrectly implemented in Node <16.3.0 - "spread parameters after optional chaining"; seeissue 46325. If you use this feature and need to support versions of Node before 16.3.0, you may need to droptarget toES2019.

Node 14

{"compilerOptions": {"lib": ["ES2020"],"module":"node16","target":"ES2020"  }}

Note: Due to a V8 bug, one rarely-used ES2020 feature was incorrectly implemented in all releases of Node 14 - "spread parameters after optional chaining"; seeissue 46325. If you use this feature, you may need to droptarget toES2019.

Node 12

{"compilerOptions": {"lib": ["ES2019"],"module":"node16","target":"ES2019"  }}

Node 10

{"compilerOptions": {"lib": ["es2018"],"module":"commonjs","target":"es2018"  }}

Node 8

{"compilerOptions": {"lib": ["es2017"],"module":"commonjs","target":"es2017"  }}

Want to contribute to this Wiki?

Fork it and send a pull request.

News

Debugging TypeScript

Contributing to TypeScript

Building Tools for TypeScript

FAQs

The Main Repo

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp