Skip to content

Commit

Permalink
doc: add suggested tsconfig for type stripping
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-ippolito committed Oct 25, 2024
1 parent 2505e21 commit 8377c51
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions doc/api/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@ 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.

The suggested `tsconfig.json` settings for type stripping are:

```json
{
"compilerOptions": {
"module": "nodenext",
"allowImportingTsExtensions": true,
"rewriteRelativeImportExtensions": true,
"verbatimModuleSyntax": true
}
}
```

### Determining module system

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

0 comments on commit 8377c51

Please sign in to comment.