From 0bebd507fd3f1601142ad6225ca53c6aca682617 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Fri, 21 Jan 2022 13:30:50 -0500 Subject: [PATCH] more wordsmithing --- website/docs/how-it-works.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/website/docs/how-it-works.md b/website/docs/how-it-works.md index dd3b0cc66..18a66f3f0 100644 --- a/website/docs/how-it-works.md +++ b/website/docs/how-it-works.md @@ -22,4 +22,10 @@ By default, **TypeScript Node** avoids compiling files in `/node_modules/` for t 2. Transpiling the entire dependency tree will make your project slower 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 -If you need to import uncompiled TypeScript within `node_modules`, use [`--skipIgnore`](./options#transpilation) or [`TS_NODE_SKIP_IGNORE`](./options#transpilation) to bypass this restriction. If a compiled JavaScript file with the same name already exists, the TypeScript will be ignored unless you also use [`--preferTsExts`](./options#transpilation). +If you need to import uncompiled TypeScript within `node_modules`, use [`--skipIgnore`](./options#transpilation) or [`TS_NODE_SKIP_IGNORE`](./options#transpilation) to bypass this restriction. + +## Skipping precompiled TypeScript + +If a compiled JavaScript file with the same name as a TypeScript file already exists, the TypeScript file will be ignored. ts-node will execute the pre-compiled JavaScript. + +To force ts-node to compile the TypeScript source, not the precompiled JavaScript, use [`--preferTsExts`](./options#transpilation).