Skip to content

Commit 56638fe

Browse files
webstrandcspotcode
andauthored
Note skip-ignore for "Skipping node_modules" (#1553)
* Note `skip-ignore` for "Skipping `node_modules`" * Remove spurious duplication * update * revert changes to readme; readme is built from docs/ * more wordsmithing * more tweaks Co-authored-by: Andrew Bradley <cspotcode@gmail.com>
1 parent bc03a3e commit 56638fe

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

website/docs/how-it-works.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,16 @@ Vanilla `node` loads `.js` by reading code from disk and executing it. Our hook
1616
1717
## Skipping `node_modules`
1818

19-
By default, **TypeScript Node** avoids compiling files in `/node_modules/` for three reasons:
19+
By default, ts-node avoids compiling files in `/node_modules/` for three reasons:
2020

2121
1. Modules should always be published in a format node.js can consume
2222
2. Transpiling the entire dependency tree will make your project slower
2323
3. Differing behaviours between TypeScript and node.js (e.g. ES2015 modules) can result in a project that works until you decide to support a feature natively from node.js
2424

25+
If you need to import uncompiled TypeScript in `node_modules`, use [`--skipIgnore`](./options#transpilation) or [`TS_NODE_SKIP_IGNORE`](./options#transpilation) to bypass this restriction.
26+
27+
## Skipping pre-compiled TypeScript
28+
29+
If a compiled JavaScript file with the same name as a TypeScript file already exists, the TypeScript file will be ignored. ts-node will import the pre-compiled JavaScript.
30+
31+
To force ts-node to import the TypeScript source, not the precompiled JavaScript, use [`--preferTsExts`](./options#transpilation).

0 commit comments

Comments
 (0)