DEV Community

teaganga
teaganga

Posted on

How To add arguments to a launch configuration in vscode

Just edit


 in the project folder and add the args you desire as an array in the json configuration. The example here is in javascript, but it can work very easily in python projects, go or any other language:



```json
     ...
            "args": [ 
                "--config",
                "./config/settings.json"
            ], 
     ...
Enter fullscreen mode Exit fullscreen mode

A full configuration here:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "MyApp",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "program": "${workspaceFolder}/app.js",
            "args": [ 
                "--config",
                "./config/settings.json"
            ],               
        }
    ]
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)