Monday, April 18, 2016

Grunt for Noobs

Prerequisite knowledge: Node.js, npm

Grunt is a JavaScript minification tool. It can take a bunch of separate .js files, pack them all into a single .js file, and make that file really small by doing things like removing comments and unnecessary whitespace, and turning long variable names into single characters.

Conveniently, this also serves to obfuscate your code, making it trickier to hack around in or repurpose without permission.

This can be useful when you've reached the stage where you have a bunch of code in lots of different files, and you want to put them all into one file to stick them on your server (this is part of deployment.)

I used the following video to learn Grunt. It gets right to the point with a nice variety of examples.



No comments:

Post a Comment