mirror of https://github.com/nodejs/node.git
doc: add suggested tsconfig for type stripping
PR-URL: https://github.com/nodejs/node/pull/55534 Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit is contained in:
parent
bb78904548
commit
f77bf65059
|
@ -68,6 +68,21 @@ By intentionally not supporting syntaxes that require JavaScript code
|
|||
generation, and by replacing inline types with whitespace, Node.js can run
|
||||
TypeScript code without the need for source maps.
|
||||
|
||||
Type stripping works with most versions of TypeScript
|
||||
but we recommend version 5.7 or newer with the following `tsconfig.json` settings:
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "nodenext",
|
||||
"allowImportingTsExtensions": true,
|
||||
"rewriteRelativeImportExtensions": true,
|
||||
"verbatimModuleSyntax": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Determining module system
|
||||
|
||||
Node.js supports both [CommonJS][] and [ES Modules][] syntax in TypeScript
|
||||
|
|
Loading…
Reference in New Issue