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",
|
"console": "integratedTerminal",
|
||||||
"internalConsoleOptions": "neverOpen"
|
"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",
|
"type": "node",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
|
@ -15,6 +15,7 @@ module.exports = (cli) => {
|
|||||||
.option('--client')
|
.option('--client')
|
||||||
.option('--server')
|
.option('--server')
|
||||||
.option('--db-sync')
|
.option('--db-sync')
|
||||||
|
.option('--inspect [port]')
|
||||||
.allowUnknownOption()
|
.allowUnknownOption()
|
||||||
.action(async (opts) => {
|
.action(async (opts) => {
|
||||||
promptForTs();
|
promptForTs();
|
||||||
@ -33,7 +34,7 @@ module.exports = (cli) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { port, client, server } = opts;
|
const { port, client, server, inspect } = opts;
|
||||||
|
|
||||||
if (port) {
|
if (port) {
|
||||||
process.env.APP_PORT = opts.port;
|
process.env.APP_PORT = opts.port;
|
||||||
@ -59,8 +60,13 @@ module.exports = (cli) => {
|
|||||||
if (server || !client) {
|
if (server || !client) {
|
||||||
console.log('starting server', serverPort);
|
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 = [
|
const argv = [
|
||||||
'watch',
|
'watch',
|
||||||
|
...(inspect ? [`--inspect=${inspect === true ? 9229 : inspect}`] : []),
|
||||||
'--ignore=./storage/plugins/**',
|
'--ignore=./storage/plugins/**',
|
||||||
'--tsconfig',
|
'--tsconfig',
|
||||||
SERVER_TSCONFIG_PATH,
|
SERVER_TSCONFIG_PATH,
|
||||||
@ -68,7 +74,7 @@ module.exports = (cli) => {
|
|||||||
'tsconfig-paths/register',
|
'tsconfig-paths/register',
|
||||||
`${APP_PACKAGE_ROOT}/src/index.ts`,
|
`${APP_PACKAGE_ROOT}/src/index.ts`,
|
||||||
'start',
|
'start',
|
||||||
...process.argv.slice(3),
|
...filteredArgs.slice(3),
|
||||||
`--port=${serverPort}`,
|
`--port=${serverPort}`,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user