A key part of any developer's workflow should be a process to minify the scripts used in a site. This has the benefit of reducing the size of the downloaded content to a page.
We can of course do this manually, but it's a time consuming process which adds little benefit; a smarter way is to let NodeJS take care of this for us. The beauty of doing this means that we can configure Node to run with a package such as grunt-contrib-watch
; any changes we make would be minified automatically. There may even be occasions when we decide not to produce a minified file; if we're unsure that the code we are writing is going to work. At times like this, we can instead fire off Grunt from within our text editor, if we're using a package such as Sublime Text.
Tip
If you want to implement that level of control within Sublime Text, then take a look at sublime-grunt
, available from https://github.com/tvooo/sublime-grunt.
Okay, let's start with setting up our minification process. For...