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 server
or grunt test
within WebStorm, it would make debugging a lot easier if it's possible with external tools like grunt.
To start debugging, hold Ctrl+Shift and click the link. WebStorm starts a debugging session with an automatically generated Attach to Node. js/Chrome configuration.
grunt. util. _ is deprecated and we highly encourage you to npm install lodash and var _ = require('lodash') to use lodash .
To run a script, open it in the editor or select it in the Project tool window, and then select Run <script file name> from the context menu. WebStorm creates a temporary run/debug configuration of the type Node. js. To run a test, click the gutter icon next to it or press Ctrl+Shift+F10 .
You have to run grunt-cli as a Node application:
/Users/someuser/nvm/v0.10.5/bin/node
Gruntfile.js
directory, ie /Projects/someproject
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)default
or test
Click on Run or Debug and you are done :)
I just happened to try this in WebStorm 10 today. I'm not sure if it's a new feature but WebStorm have integrated the steps described by @diego so you don't have to perform them manually:
You can set breakpoints etc. in Gruntfile.js
just like you would any other file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With