From 32a2068374d0cc045b1f23d3f7ed2b2145f71104 Mon Sep 17 00:00:00 2001 From: Bert Verhelst Date: Thu, 13 Feb 2020 18:01:36 +0100 Subject: [PATCH 1/3] 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 --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index b7389536e..3125811b5 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,20 @@ 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) + +Run > Edit Configurations > click the plus icon at the top left > Node.js + +Node interpreter: node.js (the default should be fine) +Node parameters: `--inspect=0.0.0.0:9229 --require ts-node/register --require tsconfig-paths/register` +Working directory: default should be fine +Javascript file: select the main ts file you want to run. eg: `server\index.ts` +Application parameters: Extra options for the ts_node process. eg: `--project tsconfig.json --r` +Environment variables: `TS_NODE_TRANSPILE_ONLY=true` + +Apply and OK +Click the green triangle at the top of the intellij window to run or the green bug icon to debug + ## 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: From 897b92e862358cadf4ed536c3b1b5fb9a951642d Mon Sep 17 00:00:00 2001 From: Bert Verhelst Date: Sun, 16 Feb 2020 19:32:07 +0100 Subject: [PATCH 2/3] fix(readme): fix minor issues with intellij readme --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3125811b5..67cdbc641 100644 --- a/README.md +++ b/README.md @@ -99,14 +99,14 @@ Create a new node.js configuration, add `-r ts-node/register` to node args and m Run > Edit Configurations > click the plus icon at the top left > Node.js Node interpreter: node.js (the default should be fine) -Node parameters: `--inspect=0.0.0.0:9229 --require ts-node/register --require tsconfig-paths/register` +Node parameters: `--inspect=0.0.0.0:9229 --require ts-node/register` Working directory: default should be fine -Javascript file: select the main ts file you want to run. eg: `server\index.ts` -Application parameters: Extra options for the ts_node process. eg: `--project tsconfig.json --r` +Javascript file: select the main ts file you want to run. eg: `server/index.ts` +Application parameters: Extra options for the ts-node process. eg: `--project tsconfig.json` Environment variables: `TS_NODE_TRANSPILE_ONLY=true` Apply and OK -Click the green triangle at the top of the intellij window to run or the green bug icon to debug +Click the green triangle at the top of the IntelliJ window to run or the green bug icon to debug. ## How It Works From cc79549527ae30e4ad1051a0273b1dc714365c6a Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Sun, 16 Feb 2020 15:38:10 -0500 Subject: [PATCH 3/3] Simplify IntelliJ / Webstorm debug configuration to more closely align with the VSCode example --- README.md | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 67cdbc641..1d7f15061 100644 --- a/README.md +++ b/README.md @@ -94,19 +94,11 @@ 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) +### IntelliJ (and WebStorm) -Run > Edit Configurations > click the plus icon at the top left > Node.js +Create a new Node.js configuration and add `-r ts-node/register` to "Node parameters." -Node interpreter: node.js (the default should be fine) -Node parameters: `--inspect=0.0.0.0:9229 --require ts-node/register` -Working directory: default should be fine -Javascript file: select the main ts file you want to run. eg: `server/index.ts` -Application parameters: Extra options for the ts-node process. eg: `--project tsconfig.json` -Environment variables: `TS_NODE_TRANSPILE_ONLY=true` - -Apply and OK -Click the green triangle at the top of the IntelliJ window to run or the green bug icon to debug. +**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