Setup a launch task in VS Code within a subfolder

Viewed 2130

My workspace folder structure is as follows:

main_folder

offline_unit

gulpfile.babel.js

online_unit

test_unit

I am able to setup launch.json only in the main_folder, how do I set it up inside offline_unit?

I have tried moving .vscode folder to within offline_unit, didn't work.
The launch.json looks like this

{
    "version": "0.2.0",
    "configurations": [ 
        {
            "type": "node",
            "request": "launch",
            "name": "Gulp task",
            "program": "/usr/local/bin/gulp",
            "args": [
                "build"
            ]
        }
    ]
}
1 Answers

I got it to work in a slightly elaborate way, using the following launch.json:

...
{
    "type": "node",
    "request": "launch",
    "name": "Gulp task",
    "program": "/usr/local/bin/gulp",
    "args": [
        "--gulpfile",
        "offline-processor/gulpfile.babel.js",
        "build"
    ]
}
...

Specifying the global gulp as the program, and using --gulpfile to specify the path of my nested gulpfile.babel.js

Any better way to do this?

Related