From 08c11341a4acae9f0c68ef57141248e9d1d2be3e Mon Sep 17 00:00:00 2001 From: Ben Winding Date: Fri, 8 May 2020 09:39:06 +0930 Subject: [PATCH 1/2] Update Readme fixes #116 --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 6bf06b6..da2af6e 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,35 @@ mocha -r ts-node/register -r tsconfig-paths/register "test/**/*.ts" As long as the command has something similar to a `--require` option that can load a module before it starts, tsconfig-paths should be able to work with it. +### With `ts-node` and VSCode + +``` js +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Debug Functions", + "request": "launch", + "type": "node", + "runtimeArgs": [ + "-r", + "${workspaceFolder}/functions/node_modules/ts-node/register", + "-r", + "${workspaceFolder}/functions/node_modules/tsconfig-paths/register" + ], + "args": ["${workspaceFolder}/functions/src/index.ts"], + "cwd": "${workspaceFolder}", + "protocol": "inspector", + "env": { + "NODE_ENV": "development", + "TS_NODE_PROJECT": "${workspaceFolder}/functions/tsconfig.json" + }, + "outFiles": ["${workspaceFolder}/functions/lib/**/*.js"] + } + ] +} +``` + ## Bootstrapping with explicit params If you want more granular control over tsconfig-paths you can bootstrap it. This can be useful if you for instance have compiled with `tsc` to another directory where `tsconfig.json` doesn't exists. From 4b1fb45f304e5194a27f9e7a94eac3a03a366882 Mon Sep 17 00:00:00 2001 From: Ben Winding Date: Fri, 8 May 2020 09:49:20 +0930 Subject: [PATCH 2/2] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index da2af6e..d713258 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,8 @@ As long as the command has something similar to a `--require` option that can lo ### With `ts-node` and VSCode +The following is an example configuration for the `.vscode/launch.json`. + ``` js { "version": "0.2.0",