Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97355

VSCode: Automatically run npm script on starting debugging of a web project

$
0
0

So here is my VS code launch.json file:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:4321",
            "port": 9222,
            "webRoot": "${workspaceFolder}"
        }
    ]
}

What I want is run npm start command right before debugging begins i.e running dev server then launching a Chrome instance and navigating to the provided url.

So, I added the following snippet to the config file and ran the debug:

"cwd": "${workspaceRoot}",
            "runtimeExecutable": "npm",
            "runtimeArgs": [
               "start"
            ]

but I got the this error:

Attribute runtimeExecutable does not exist ('npm')

Any help?


Viewing all articles
Browse latest Browse all 97355

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>