在Visual Studio Code中,如何在launch.json中传递参数

问题描述:

在Visual Studio Code中,启动我正在编写的应用程序的 launch.json 文件中,如何添加命令行参数?

In Visual Studio Code, in the launch.json file that launches the app I'm writing, how do I add command line arguments?

As described in the documentation, you need to use the args attribute. E.g.

{
    "type": "node",
    "request": "launch",
    "name": "Debug App",
    "program": "${workspaceFolder}/main.js",
    "args": ["arg1", "arg2", "arg3"]
}