GeezerVison is showing github.com — doc: add path aliases typescript doc · nodejs/node@cbe09b5
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/typescript.md +8Lines changed: 8 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -172,14 +172,22 @@ To discourage package authors from publishing packages written in TypeScript, |
172 | 172 | Node.js will by default refuse to handle TypeScript files inside folders under |
173 | 173 | a `node_modules` path. |
174 | 174 |
|
| 175 | +### Paths aliases |
| 176 | + |
| 177 | +[`tsconfig` "paths"][] won't be transformed and therefore produce an error. The closest |
| 178 | +feature available is [subpath imports][] with the limitation that they need to start |
| 179 | +with `#`. |
| 180 | + |
175 | 181 | [CommonJS]: modules.md |
176 | 182 | [ES Modules]: esm.md |
177 | 183 | [Full TypeScript support]: #full-typescript-support |
178 | 184 | [`--experimental-strip-types`]: cli.md#--experimental-strip-types |
179 | 185 | [`--experimental-transform-types`]: cli.md#--experimental-transform-types |
| 186 | +[`tsconfig` "paths"]: https://www.typescriptlang.org/tsconfig/#paths |
180 | 187 | [`tsx`]: https://tsx.is/ |
181 | 188 | [`verbatimModuleSyntax`]: https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax |
182 | 189 | [file extensions are mandatory]: esm.md#mandatory-file-extensions |
183 | 190 | [full support]: #full-typescript-support |
| 191 | +[subpath imports]: packages.md#subpath-imports |
184 | 192 | [the same way as `.js` files.]: packages.md#determining-module-system |
185 | 193 | [type stripping]: #type-stripping |