Replies: 7 comments
-
| 
         Yeah, I can't figure this out either... The readme explains how to configure a vscode task that launches a  This is what I'm trying, but it just gives me a  {
  "type": "node",
  "request": "launch",
  "name": "Develop",
  "runtimeArgs": [
    "-r",
    "ts-node/register"
  ],
  "args": [
    "--project",
    "${workspaceRoot}/tools/tsconfig.json",
    "${workspaceRoot}/tools/scripts/develop.ts"
  ],
  "console": "integratedTerminal"
}And on a side note, the above is actually not even what I originally set out to achieve. "develop": "ts-node --project 'tools/tsconfig.json' 'tools/scripts/develop'"But I cannot for the life of me figure out how to make either of those work. Any guidance would be much appreciated :-)  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Right, it actually looks like #734 answers my first question. I'd still love to know if there's a way to just debug the NPM package script though, as replicating all the scripts in the vscode launch config is not exactly ideal. Oh, and please merge #738, so no more time will be wasted on this :-)  | 
  
Beta Was this translation helpful? Give feedback.
-
        @thomas-darling what is project pipe do?  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Hmm, now I wonder if we're actually talking about two different things here... I thought this issue was about how to specify the path to the   | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         The answer is in the README {
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Launch Server",
      "protocol": "inspector",
      "runtimeVersion": "8.11.4",
      "runtimeArgs": ["-r", "ts-node/register", "-r", "tsconfig-paths/register"],
      "args": ["src/main.ts"],
      "cwd": "${workspaceFolder}",
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen",
      "env": {
        "TS_NODE_PROJECT": "tsconfig.json",
        "TS_NODE_TRANSPILE_ONLY": "true"
      }
    }
  ]
} | 
  
Beta Was this translation helpful? Give feedback.
-
        
 good~  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         create scripts on package.json and use the runtimeExecutable and runtimeArgs on .vscode/launch.json: package.json {
  "name": "someproject",
  "version": "1.0.0",
  "description": "Some project",
  "main": "index.js",
  "author": "Guihgo",
  "license": "MIT",
  "scripts": {
    "dev": "tsnd -r tsconfig-paths/register --transpile-only --respawn --ignore-watch node_modules src/index.ts",
    "build": "tsc",
    "test": "jest"
  },
  "private": false,
  "devDependencies": {
       [...]
  },
  "dependencies": {}
}.vscode/launch.json {
    "version": "0.2.0",
    "configurations": [
        {
            "name": "DEV",
            "type": "node",
            "request": "launch",
            "restart": true,
            "skipFiles": [
                "<node_internals>/**"
            ],
            "runtimeExecutable": "yarn",
            "runtimeArgs": [
                "dev"
            ]
        },
        {
            "name": "TEST",
            "type": "node",
            "request": "launch",
            "restart": true,
            "skipFiles": [
                "<node_internals>/**"
            ],
            "runtimeExecutable": "yarn",
            "runtimeArgs": [
                "test"
            ]
        }
    ]
}in runtimeExecutable you can set to npm, but i thinks you needs add "run" argumment on runtimeArgs as following .vscode/launch.json {
    "version": "0.2.0",
    "configurations": [
        {
            "name": "DEV",
            "type": "node",
            "request": "launch",
            "restart": true,
            "skipFiles": [
                "<node_internals>/**"
            ],
            "runtimeExecutable": "npm",
            "runtimeArgs": [
                "run",
                "dev"
            ]
        },
        {
            "name": "TEST",
            "type": "node",
            "request": "launch",
            "restart": true,
            "skipFiles": [
                "<node_internals>/**"
            ],
            "runtimeExecutable": "npm",
            "runtimeArgs": [
                "run",
                "test"
            ]
        }
    ]
} | 
  
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Can you please give me example of how to config vs-code launch with ts-node and tsconfig-path?
Tanks.
Beta Was this translation helpful? Give feedback.
All reactions