Skip to content

Instantly share code, notes, and snippets.

@chonthu
Created July 1, 2013 18:50
Show Gist options
  • Save chonthu/5903494 to your computer and use it in GitHub Desktop.
Save chonthu/5903494 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
handlebars: {
compile: {
options: {
namespace: "Handlebars.templates",
processName: function(filepath) {
var pieces = filepath.split("/");
return pieces[pieces.length - 1].replace(/.handlebars$/ , '');
}
},
files: {
"htdocs/js/template.js": "templates/handlebars/*.handlebars"
}
}
},
watch: {
default: {
files: "templates/handlebars/*.handlebars",
tasks: ['handlebars']
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-handlebars');
grunt.registerTask('default', ['handlebars']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment