From 4a2f697477daef3589e48a97a59cc939230e48b5 Mon Sep 17 00:00:00 2001 From: Michael Zlatkovsky Date: Tue, 27 Nov 2018 14:34:05 -0800 Subject: [PATCH] Add tip re. --project option in VSCode config --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 30d638655..ce8b4c7c2 100644 --- a/README.md +++ b/README.md @@ -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 ` 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": "" }` + ## 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: