Created
September 23, 2013 20:49
-
-
Save lrobeson/6676760 to your computer and use it in GitHub Desktop.
Grunt config file for Compass / Sass watch, sound notification, and LiveReload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice touch with the sound.