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

Appearance settings

Commit f77bf65

Browse filesBrowse files
marco-ippolitoRafaelGSS
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 bb78904 commit f77bf65
Copy full SHA for f77bf65

File tree

Expand file treeCollapse file tree

1 file changed

+15
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+15
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/typescript.md‎

Copy file name to clipboardExpand all lines: doc/api/typescript.md
+15Lines changed: 15 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.