Using node-inspector with Grunt tasks

后端 未结 7 1908
悲哀的现实
悲哀的现实 2020-12-04 06:20

Does someone used node-inspector with Grunt for application debugging? If not, Can you recommend a debugging tool for Grunt based apps?

I\'m working with nodejs for

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-04 06:50

    2019 update

    • If you want to launch the grunt task in debug mode and break at first line:

      node --inspect-brk $(which grunt) taskName

    • If you want to launch the grunt task in debug mode at a specific port:

      node --inspect-brk=8080 $(which grunt) taskName

    • if you want to attache VSCODE to the node process running the debugging session of grunt, use the following configuration in vscode:

    {
      // 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": "attach",
          "name": "Attach by port IP 5656",
          "port": 8080
        }
      ]
    }
    
    

提交回复
热议问题