Skip to content

Instantly share code, notes, and snippets.

@heldrida
Created August 21, 2014 09:04
Show Gist options
  • Save heldrida/b8fbe325c3546b9d42fc to your computer and use it in GitHub Desktop.
Save heldrida/b8fbe325c3546b9d42fc to your computer and use it in GitHub Desktop.
Gruntfile.js: Basic watch configuration, observing html, sass and javascript files
/*globals module, grunt*/
'use strict';
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
options: {
livereload: true
},
html: {
files: ['*.html']
},
sass: {
files: ['sass/main.scss'],
tasks: ['sass']
},
scripts: {
files: ['js/main.js']
}
},
sass: {
dist: {
files: [{
expand: true,
cwd: 'sass', // src is relative to this path
src: ['*.scss'],
dest: 'css', // destination path
ext: '.css'
}]
}
}
});
// Load the plugin
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass');
// 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