You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
Copy file name to clipboardExpand all lines: website/docs/how-it-works.md
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,16 @@ Vanilla `node` loads `.js` by reading code from disk and executing it. Our hook
16
16
17
17
## Skipping `node_modules`
18
18
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:
20
20
21
21
1. Modules should always be published in a format node.js can consume
22
22
2. Transpiling the entire dependency tree will make your project slower
23
23
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
24
24
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