Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions to readme for intellij / webstorm #958

Merged
merged 3 commits into from Mar 2, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Expand Up @@ -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 <tsconfig.json>` 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": "<tsconfig.json>" }`.

### 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`
bertyhell marked this conversation as resolved.
Show resolved Hide resolved
Working directory: default should be fine
Javascript file: select the main ts file you want to run. eg: `server\index.ts`
bertyhell marked this conversation as resolved.
Show resolved Hide resolved
Application parameters: Extra options for the ts_node process. eg: `--project tsconfig.json --r`
bertyhell marked this conversation as resolved.
Show resolved Hide resolved
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
bertyhell marked this conversation as resolved.
Show resolved Hide resolved

## 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