From 6596a0d2c473fcdbe36b063c020e323cc408ecf7 Mon Sep 17 00:00:00 2001 From: Bert Verhelst Date: Mon, 2 Mar 2020 05:41:18 +0100 Subject: [PATCH] Add instructions to readme for intellij / webstorm (#958) * Add instructions to readme for intellij / webstorm based on: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360006528060-New-Webstorm-is-missing-debug-integration-with-Typescript * fix(readme): fix minor issues with intellij readme * Simplify IntelliJ / Webstorm debug configuration to more closely align with the VSCode example Co-authored-by: Andrew Bradley --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index a39d7ff8c..7f0e155dc 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,12 @@ Create a new node.js configuration, add `-r ts-node/register` to node args and m **Note:** If you are using the `--project ` command line 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": "" }`. +### IntelliJ (and WebStorm) + +Create a new Node.js configuration and add `-r ts-node/register` to "Node parameters." + +**Note:** If you are using the `--project ` command line argument as per the [Configuration Options](#configuration-options), and want to apply this same behavior when launching in IntelliJ, specify under "Environment Variables": `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: