- concatenate files;
- run unit tests with nodeunit;
- generate project scaffolding from a predefined template;
- validate files with JSHint;
- minify files with UglifyJS;
- run QUnit unit tests in a headless PhantomJS instance;
- run predefined tasks whenever watched files change.
- start a static web server;
All other functionality is stored in plugins, so Grunt can easily be customized to suit needs of any particular project. Grunt has plugins for:
- compiling Sass/Less/Stylus files to CSS, and CoffeeScript/LiveScript to JS;
- PNG and JPEG file size optimization;
- automatic inlining and spriting of images;
- optimization for Require.js and Google Closure Compiler;
- precompilation of Handlebars, Jade, Underscore, Mustache, Eco or Hogan templates;
- running tests using Sauce Labs (supports QUnit, Jasmine, Mocha and YUI tests).
There are already hundreds of plugins to choose from, so Grunt can be used to automate just about anything with little effort. List of plugins is regularly updated (when a new Node.js module with the keyword “gruntplugin“ is published, it is automatically added to the list).