- Open your project’s folder in WebStorm.
- Click Run… Edit Configurations…
- Add a new configuration for Node.js (the green + sign)
- Name it “Debug Grunt”
- Set the application parameters to the grunt task you wish to debug, for example dev or just leave blank if it is default.
Thanks to Diego and everyone else who answered this question on Stack Overflow.