-
-
Notifications
You must be signed in to change notification settings - Fork 534
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
vscode launch config ts-node with tsconfig-paths #777
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 :-) |
@thomas-darling what is project pipe do? |
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 |
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"
}
}
]
} |
good~ |
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"
]
}
]
} |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Can you please give me example of how to config vs-code launch with ts-node and tsconfig-path?
Tanks.
The text was updated successfully, but these errors were encountered: