Skip to content

Instantly share code, notes, and snippets.

@jasonvarga
Created January 17, 2014 16:47
Show Gist options
  • Save jasonvarga/8476768 to your computer and use it in GitHub Desktop.
Save jasonvarga/8476768 to your computer and use it in GitHub Desktop.
Getting Grunt to watch Statamic files
module.exports = function(grunt) {
grunt.initConfig({
...
themePath: '_themes/theme_name',
watch: {
options: { livereload: true },
css: {
files: ['<%= themePath %>/sass/**'],
tasks: ['compass']
},
scripts: {
files: [
'<%= themePath %>/js/**',
'!<%= themePath %>/js/themename.js'
],
tasks: ['concat', 'uglify']
},
templates: {
files: [
'<%= themePath %>/templates/**',
'<%= themePath %>/partials/**',
'<%= themePath %>/layouts/**'
]
},
content: {
files: ['_content/**']
}
}
...
});
};
@jasonvarga
Copy link
Author

This assumes Gruntfile.js is in the project root directory.
ie. Same folder as _app, _themes, etc

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