Posts

Showing posts with the label grunt task

[Javascript] - Grunt by Example - A Tutorial for JavaScript's Task Runner

What’s Grunt used for? Automating front-end and JavaScript workflow tasks. Refreshing the browser when you change a script. Minifying and concatenating. Running tests. Think   rake   and   guard , if you’re coming from the Ruby world. Enter Grunt by Example! A blow-by-blow tutorial. Just the way I like it. Let’s dive in. The catch - Grunt configuration files can be fairly convoluted at first glance, usually due to the fact that developers add more and more steps to their workflow over time. Grunt is just a task runner. Every unit of functionality that you would want is usually achieved with a separate npm package (a grunt “plugin”). npm search grunt  to view literally every grunt plugin available. Get the command line interface:  npm install -g grunt-cli Add the actual grunt task runner as a development dependency to your project ( --save-dev  adds the package as a dependency to  package.json ): npm install --save-dev grunt Let’s fol...