DEV Community

teaganga
teaganga

Posted on

1

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)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay