chore(debug): add debug config (#475)

This commit is contained in:
Junyi 2022-06-06 23:01:37 +08:00 committed by GitHub
parent fe02557003
commit 588ee21f4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 53 additions and 2 deletions

46
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,46 @@
{
// 使 IntelliSense
//
// 访: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Server",
"cmd": "${workspaceRoot}",
"runtimeArgs": [
"-r", "dotenv/config",
"-r", "tsconfig-paths/register",
"-r", "ts-node/register"
],
"args": ["${workspaceRoot}/packages/app/server/src/index.ts", "start"],
"port": 9229,
"skipFiles": [
"<node_internals>/**"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
{
"type": "node",
"request": "launch",
"name": "Debug Jest Tests",
"runtimeExecutable": "yarn",
"runtimeArgs": [
"run",
"--inspect-brk",
"test",
"--runInBand",
// could be any single file path to debug
"${workspaceFolder}/packages/"
],
"port": 9229,
"skipFiles": [
"<node_internals>/**"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}

View File

@ -73,7 +73,7 @@ module.exports = (cli) => {
env: {
PORT: clientPort,
APP_ROOT: `packages/${APP_PACKAGE_ROOT}/client`,
PROXY_TARGET_URL: serverPort ? `http://127.0.0.1:${serverPort}` : undefined,
PROXY_TARGET_URL: process.env.PROXY_TARGET_URL || (serverPort ? `http://127.0.0.1:${serverPort}` : undefined),
},
});
}

View File

@ -27,5 +27,10 @@
"packages/core/*/src"
]
}
},
"ts-node": {
"compilerOptions": {
"module": "commonjs"
}
}
}