Grunt Setup Example

Grunt - The JavaScript Task Runner by Eric on February 1, 2020

Developing for the web can be tedious sometimes.  Not only do you need to develop using multiple languages you need to make things as easy for yourself as you can when it comes to deployment.  One of the most basic things you can do to make your source files ready for production is to minify all of your JavaScript files.  There are a few programs out there that will do it for you but today I want to show you Grunt. The great thing about Grunt is it will autocompile and minify your code even as you're developing.  For example, in your templates you set the source for your scripts to the .min.js versions.  Normally once you make a change to the source you'd need to manually minify the file again before refreshing the page.  Grunt will do all of the minifying for you and using one of their plugins can watch your code for changes and automatically recompile when you save. I'm going to go through a basic setup for Grunt.  There are many more advanced things you can do with Grunt but I'...