Grunt debugging from Webstorm

后端 未结 2 1908
小鲜肉
小鲜肉 2020-12-12 13:56

Its possible to run grunt tasks within WebStorm through external tools. However, is it possible to avail debugging with external tools? By running tasks like grunt se

2条回答
  •  遥遥无期
    2020-12-12 14:17

    You have to run grunt-cli as a Node application:

    • Create a new Node.js Run/Debug configuration: Run->Edit configurations...
    • In Path to Node choose your node binary, ie: /Users/someuser/nvm/v0.10.5/bin/node
    • In Working Directory, choose your Gruntfile.js directory, ie /Projects/someproject
    • In Path to Node App JS File, choose your Grunt CLI path (you can choose the grunt-cli symlink created on your node bin directory, WebStorm will use the symlink target), ie: /Users/someuser/nvm/v0.10.5/lib/node_modules/grunt-cli/bin/grunt (C:\Users\someuser\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt on Windows 7)
    • In Application parameters enter the Grunt task to run, eg default or test

    Click on Run or Debug and you are done :)

提交回复
热议问题