Skip to content

Commit

Permalink
more tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed Jan 21, 2022
1 parent 0bebd50 commit e3c6c3b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions website/docs/how-it-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ Vanilla `node` loads `.js` by reading code from disk and executing it. Our hook
## Skipping `node_modules`

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

1. Modules should always be published in a format node.js can consume
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 you need to import uncompiled TypeScript in `node_modules`, use [`--skipIgnore`](./options#transpilation) or [`TS_NODE_SKIP_IGNORE`](./options#transpilation) to bypass this restriction.

## Skipping precompiled TypeScript
## Skipping pre-compiled 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.
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.

To force ts-node to compile the TypeScript source, not the precompiled JavaScript, use [`--preferTsExts`](./options#transpilation).
To force ts-node to import the TypeScript source, not the precompiled JavaScript, use [`--preferTsExts`](./options#transpilation).

0 comments on commit e3c6c3b

Please sign in to comment.