美文网首页
vscode调试npm命令

vscode调试npm命令

作者: 小俊的世界 | 来源:发表于2022-01-28 14:39 被阅读0次

起因

项目的开发中需要使用到大量的npm的命令,希望是能够进行方便的调试。

命令

{
 "scripts": {
    "create": "node ./createFile.js",
  },
 ...
}

设置方式

// 利用runtimeExcutable
 {
      "name":"npm run create",
      "type":"node",
      "request":"launch",
      "runtimeExecutable": "npm",
      "runtimeArgs": ["run", "create"]
 }
// 利用command 
{
      "command": "npm run create",
      "name": "Run npm create",
      "request": "launch",
      "type": "node-terminal"
}

效果

image.png

相关文章

网友评论

      本文标题:vscode调试npm命令

      本文链接:https://www.haomeiwen.com/subject/dubwhrtx.html