Skip to content

Instantly share code, notes, and snippets.

@lrobeson
Created September 23, 2013 20:49
Show Gist options
  • Save lrobeson/6676760 to your computer and use it in GitHub Desktop.
Save lrobeson/6676760 to your computer and use it in GitHub Desktop.
Grunt config file for Compass / Sass watch, sound notification, and LiveReload
// Configuring Grunt tasks:
// http://gruntjs.com/configuring-tasks
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Play sound: https://github.com/astronaughts/grunt-play
play: {
compasscomplete: {
file: '/System/Library/Sounds/purr.aiff'
},
},
// Compass task: https://npmjs.org/package/grunt-contrib-compass
compass: {
dist: {
options: {
// use default Compass config
config: 'config.rb',
bundleExec: true
}
}
},
// Watch task: https://npmjs.org/package/grunt-contrib-watch
// Includes LiveReload whenever specified files change
// Using browser extension:
// http://feedback.livereload.com/knowledgebase/articles/86242-how-do-i-install-and-use-the-browser-extensions-
watch: {
css: {
// if Sass files change, run the Compass task, play sound when finished recompiling and optionally LiveReload browser
files: [
'**/*.scss',
],
tasks: ['compass', 'play:compasscomplete'],
options: {
livereload: true,
},
},
scripts: {
// if js files change, livereload only
files: [
'js/*.js',
],
options: {
livereload: true,
},
},
images: {
// if images change, livereload only
files: [
'images/{,**/}*.{png,jpg,jpeg,gif,webp,svg}'
],
options: {
livereload: true,
},
},
},
});
// Load the plugin(s)
//grunt.loadNpmTasks('grunt-concurrent');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-play');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task(s).
grunt.registerTask('default', ['watch']);
};
@pxwise
Copy link

pxwise commented Mar 28, 2014

nice touch with the sound.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment