This document discusses how to automate development tasks using Grunt. It explains that Grunt can be used to compile Sass/Less to CSS, automatically reload content after changes, lint, concatenate and compress JavaScript files, and optimize images. It provides instructions on setting up Grunt, installing common plugins for tasks like watching files, Sass compilation, BrowserSync, Autoprefixer, JavaScript linting and minification, and image optimization. Alternatives to Grunt like Gulp and CodeKit are also mentioned.
4. Sheelah Brennan http://sheelahb.com4
• Compile Sass or Less into CSS
• Automatically reload content after changes to
CSS, JavaScript, HTML, or other assets
• Lint, concatenate, and compress JavaScript files
• Optimize images and SVG files
• Automate performance testing
What can it do?
8. Sheelah Brennan http://sheelahb.com8
• Enable source map generation to be able to view Sass/
Less source files in the browser
http://www.sitepoint.com/using-source-maps-debug-
sass-chrome/
#quicktip
10. Sheelah Brennan http://sheelahb.com10
• Synchronized cross-device and cross-browser
testing FTW
npm install grunt-browser-sync --save-
dev
http://www.browsersync.io/
BrowserSync Plugin
11. Sheelah Brennan http://sheelahb.com11
• Automatically adds vendor prefixes where
needed in your CSS
npm install grunt-postcss autoprefixer
--save-dev
Autoprefixer Plugin
12. Sheelah Brennan http://sheelahb.com12
• No need to manually include loadNpmTasks
entries for each task (npm install load-
grunt-tasks --save-dev)
• Get time metrics for each task (npm install
--save-dev time-grunt)
Automatically Load Tasks
18. Sheelah Brennan http://sheelahb.com18
• Pull down the git repo
• Install the required Grunt plugins (npm install)
Contributing to an Existing
Project Using Grunt