Skip to content

Commit

Permalink
Add tip re. --project option in VSCode config
Browse files Browse the repository at this point in the history
  • Loading branch information
Zlatkovsky authored Nov 27, 2018
1 parent d58488b commit 4a2f697
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ Create a new node.js configuration, add `-r ts-node/register` to node args and m
}
```

> TIP: If you are using the `--project <path-to-your-tsconfig.json>` commandline argument as per the [Configuration Options](#configuration-options), and want to apply this same behavior when launching in VS Code, add an "env" key into the launch configuration: `"env": { "TS_NODE_PROJECT": "<path-to-your-tsconfig.json>" }`
## How It Works

**TypeScript Node** works by registering the TypeScript compiler for `.tsx?` and `.jsx?` (when `allowJs == true`) extensions. When node.js has an extension registered (via `require.extensions`), it will use the extension internally for module resolution. When an extension is unknown to node.js, it handles the file as `.js` (JavaScript). By default, **TypeScript Node** avoids compiling files in `/node_modules/` for three reasons:
Expand Down

0 comments on commit 4a2f697

Please sign in to comment.