I am using execa
to spawn a sub-process in index.js, but I can't debug the spawned file(log_ok.js). this is the code, does anyone know how to debug it?
index.js
const execa = require('execa');
execa('node', ['./log_ok.js'], { stdio: 'inherit' })
and my launch.json:
{
"type": "node",
"request": "launch",
"name": "debug",
"program": "${workspaceFolder}/index.js",
"autoAttachChildProcesses": true
}
./log_ok.js
console.log('ok')