In a Microsoft ecosystem (i.e. WebForms/MVC/WebAPI VisualStudio projects) why should I rely on an external task runner for JavaScript files like Grunt if I already have MSBuild at my disposal as the default building/task running system?
When I first saw grunt in action I wondered why it was even being used, as it seemed to me that I could do what it was doing by relying directly on MSBuild tasks. I usually favor centralized tools for doing the same type of job, and I assume both MSBuild and Grunt are doing basically similar types of actions: running tasks against/using files as input. All the javascript files for these web projects are already referenced in the csproj anyway, so they are automatically part of the build process. Using MSBuild to process them seems much more natural to me than injecting a new framework in the middle to do that.
I believe that using another framework to perform the same type of work you already do with an existing framework is a bad decision since it adds new unnecessary dependencies that have to be learned/mastered by the team. Additionally, we all know that more moving parts equals more chances for stuff to fail in general. I also argue that MSBuild already integrates nicely with Visual Studio, while grunt requires extensions or manual command line work to run.
Is there a specific reason why MSBuild was not leveraged for the kind of work Grunt does nowadays?
I understand they are completely different ecosystems and would totally understand someone using Grunt on a non-Microsoft open source type of project, but it doesn't make sense to me that it has become a standard for .Net applications seeing that we already have a tool to do just the types of tasks it does.
Don't get me wrong, I understand the "there are many plugins available" argument, but that to me is similar to saying we should all stop using TFSBuild and migrate to Jenkins because it has more plugins readily available. It is a valid argument, but not so much as to completely dismiss TFSBuild's strengths in some situations.