调试 – 如何使用VSCode调试gulp任务

前端之家收集整理的这篇文章主要介绍了调试 – 如何使用VSCode调试gulp任务前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我需要调试一个命令gulp开始与VScode(我有一些映射错误,在透明度中的巴贝,我还不明白…). VSCode调试默认配置旨在启动节点app.js.如何修改它来触发gulp命令?

这是默认配置.如果有人提示我怎么做,我会在你的债务:)

{
    "version": "0.2.0","configurations": [
        {
            "name": "Lancer","type": "node","request": "launch","program": "${workspaceRoot}/app.js","stopOnEntry": false,"args": [],"cwd": "${workspaceRoot}","preLaunchTask": null,"runtimeExecutable": null,"runtimeArgs": [
                "--nolazy"
            ],"env": {
                "NODE_ENV": "development"
            },"externalConsole": false,"sourceMaps": false,"outDir": null
        },{
            "name": "Attacher","request": "attach","port": 5858,"address": "localhost","restart": false,"outDir": null,"localRoot": "${workspaceRoot}","remoteRoot": null
        }
    ]
}

解决方法

在“Lancer”配置中,进行以下更改.

>将程序更改为“${workspaceRoot} /node_modules/gulp/bin/gulp.js”
>更改参数为[“开始”]

在要调试的任务中设置断点并启动调试器.将“开始”更改为所需的任务名称以调试其他任务.

猜你在找的JavaScript相关文章