Feature: Grunt & NPM - Pixely-Studios/NStart GitHub Wiki
Why do we use them?
We use NPM for getting and updating our front-end dependencies. NPM as a package manager is very robust and reliable, but NPM packages cannot (so far as I know) be referenced directly by Razor Pages; and that's where Grunt comes in the picture.
Grunt is used for cleaning up our asset directory and copying the NPM packages. Grunt can be used also to bundle and minify assets, but this should be performed on a project-level basis and we don't include those two operations.
How do we use them?
- NPM gets the packages from its global instance
- On build time, after the ASP.NET solution has been compiled, grunt runs a playlist of operations needed to update the files of the platform (clean + copy)
Using this simple but effective workflow allow us to keep updated our front-end dependencies and keep our project light and consistent. You can replace Grunt with Gulp if you desire to do so, but I usually don't like including tools that I don't use.