What is the difference between args
and runtimeArgs
in launch.json?
// Optional arguments passed to the runtime executable
"runtimeArgs": []
// Command line arguments passed to the program
"args": []
Is the program not the same thing as the runtime executable?
Extra information and motivation behind the question:
I am developing a nodejs application. In my package.json
, I have a start
script:
"start": "electron ./src/Main/main.js arg2"
, and in my app code, I access process.argv[2]
which gets me arg2
, so when I run npm start
, my app works as intended.
When I run the app from VSCode, however it doesn't, and the reason was that I wasn't supplying any additional arguments in launch.json
. Where should I put those arguments? process.argv
seems to contains the arguments provided in either args
or runtimeArgs
though it also sticks in some --debug-brk
argument, which I don't want.
I want to be able to use process.argv
consistently when I run the app from the command line (npm start
) or start it from VSCode.