chore(vscode): add inspect argument for attaching to debug port (#3307)
This commit is contained in:
parent
4dbac496be
commit
e8b7fbd699
10
.vscode/launch.json
vendored
10
.vscode/launch.json
vendored
@ -11,6 +11,16 @@
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen"
|
||||
},
|
||||
{
|
||||
"address": "localhost",
|
||||
"localRoot": "${workspaceFolder}",
|
||||
"name": "Attach to debug server (remote)",
|
||||
"port": 9229,
|
||||
"remoteRoot": "${workspaceFolder}",
|
||||
"request": "attach",
|
||||
"skipFiles": ["<node_internals>/**"],
|
||||
"type": "node"
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
|
@ -15,6 +15,7 @@ module.exports = (cli) => {
|
||||
.option('--client')
|
||||
.option('--server')
|
||||
.option('--db-sync')
|
||||
.option('--inspect [port]')
|
||||
.allowUnknownOption()
|
||||
.action(async (opts) => {
|
||||
promptForTs();
|
||||
@ -33,7 +34,7 @@ module.exports = (cli) => {
|
||||
return;
|
||||
}
|
||||
|
||||
const { port, client, server } = opts;
|
||||
const { port, client, server, inspect } = opts;
|
||||
|
||||
if (port) {
|
||||
process.env.APP_PORT = opts.port;
|
||||
@ -59,8 +60,13 @@ module.exports = (cli) => {
|
||||
if (server || !client) {
|
||||
console.log('starting server', serverPort);
|
||||
|
||||
const filteredArgs = process.argv.filter(
|
||||
(item, i) => !item.startsWith('--inspect') && !(process.argv[i - 1] === '--inspect' && Number.parseInt(item)),
|
||||
);
|
||||
|
||||
const argv = [
|
||||
'watch',
|
||||
...(inspect ? [`--inspect=${inspect === true ? 9229 : inspect}`] : []),
|
||||
'--ignore=./storage/plugins/**',
|
||||
'--tsconfig',
|
||||
SERVER_TSCONFIG_PATH,
|
||||
@ -68,7 +74,7 @@ module.exports = (cli) => {
|
||||
'tsconfig-paths/register',
|
||||
`${APP_PACKAGE_ROOT}/src/index.ts`,
|
||||
'start',
|
||||
...process.argv.slice(3),
|
||||
...filteredArgs.slice(3),
|
||||
`--port=${serverPort}`,
|
||||
];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user