What is the difference between args and runtimeArgs in VSCode's launch.json?

后端 未结 2 1093
暗喜
暗喜 2021-01-01 14:17

What is the difference between args and runtimeArgs in launch.json?

// Optional arguments passed to the runtime executable
\"runtim         


        
2条回答
  •  庸人自扰
    2021-01-01 14:45

    If you remove the attribute "program", the arguments are attached after another and you don't see any difference.

    Consider following example, including "type" and "program":

             {
                
               "name": "vscode-jest-tests",
                "type": "node",
                "request": "launch",
                "program": "${workspaceFolder}/node_modules/jest-cli/bin/jest.js",
                "stopOnEntry": false,
                "args": [ 
                    "--runInBand"                       
                ],
                "cwd": "${workspaceFolder}",
                "preLaunchTask": null,
                "runtimeExecutable": null,
                "runtimeArgs": [
                    "--nolazy"
                ],
                "env": {
                    "NODE_ENV": "development"
                },
                "console": "integratedTerminal",
                "internalConsoleOptions": "neverOpen",
                "disableOptimisticBPs": true
            }
    

    => set "NODE_ENV=development" && "C:\Program Files\nodejs\node.exe" --nolazy --inspect-brk=35238 node_modules\jest-cli\bin\jest.js --runInBand

    • The runtimeArg "--nolazy" occurs behind node.exe (corresponds to type) and

    • The arg "--runInBand" occurs behind jest.js (corresonds to program)

    If you remove the attribute "program", the arguments are attached after another and you don't see any difference.

提交回复
热议问题