Skip to content

Commit 0e69f6d

Browse files
marco-ippolitoruyadorno
authored andcommitted
doc: add suggested tsconfig for type stripping
PR-URL: #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>
1 parent 2b561ab commit 0e69f6d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doc/api/typescript.md

+15
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,21 @@ By intentionally not supporting syntaxes that require JavaScript code
6868
generation, and by replacing inline types with whitespace, Node.js can run
6969
TypeScript code without the need for source maps.
7070

71+
Type stripping works with most versions of TypeScript
72+
but we recommend version 5.7 or newer with the following `tsconfig.json` settings:
73+
74+
```json
75+
{
76+
"compilerOptions": {
77+
"target": "esnext",
78+
"module": "nodenext",
79+
"allowImportingTsExtensions": true,
80+
"rewriteRelativeImportExtensions": true,
81+
"verbatimModuleSyntax": true
82+
}
83+
}
84+
```
85+
7186
### Determining module system
7287

7388
Node.js supports both [CommonJS][] and [ES Modules][] syntax in TypeScript

0 commit comments

Comments
 (0)