I recently moved to VS2017 and, it turned out I cannot make Grunt tasks work. Node is installed along with Grunt packages, Grunt task is also defined, but Task Runner Explorer in Visual Studio doesn't see it (screenshot is attached):
2 Answers
Hmm... from the documentation for that plugin a known issue is: "Projects inside nested solution folders aren't supported yet". So, my guess is that you won't be able to use this in your current structure given the location of your Gruntfile.js
. You could try to confirm this by placing that file in the project root directory.
I happened to have a Gruntfile.js in the parent folder of my projects: 'source', and VS reads it by default. I started using Grunt out of frustration with the WebCompiler extension that is now severely broken in VS2017, and doesn't show signs of being updated anytime soon. I just started using grunt outside of VS to compile my sass and bundle/minify my js, which can be frustrating for my other team members. Anyway, I noticed VS2017 automatically picks up that Gruntfile, even though it's not even in the solution folder for my project. For my non MS projects, that's how I have it set up, because I don't want that insane node-modules folder jungle to end up in my git repo. It's super frustrating that MS now wants us to use open source tools in our projects. Us modern front-end devs are in limbo with sass or scss precompilers.