public
Created

grunt-ember-handlebars plugin config for the Gruntfile + package.json. You'll have to update the Gruntfile with YOUR correct path to templates files. 1. Run `npm install` 2. Run `grunt` or `grunt watch`

  • Download Gist
Gruntfile.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
ember_handlebars: {
options: {
processName: function(filePath) {
var shortFilePath = filePath.replace(/assets\/js\/app\/templates\//, '').replace('.hbs', '');
return shortFilePath;
},
processPartialName: function(filePath) {
var shortFilePath = filePath.replace(/assets\/js\/app\/templates\//, '').replace('.hbs', '');
return shortFilePath;
}
},
compile: {
files: {
'assets/js/app/templates.js': 'assets/js/app/templates/**/*.hbs'
}
}
},
watch: {
ember_handlebars: {
files: 'assets/js/app/templates/**/*.hbs',
tasks: ['ember_handlebars']
}
}
});
 
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-ember-handlebars');
 
// Default task(s).
grunt.registerTask('default', ['ember_handlebars']);
};
package.json
JSON
1 2 3 4 5 6 7 8 9 10 11
{
"name": "Your-Name-App-Hiphenated",
"description": "Write what u want",
"version": "0.0.1",
"private": true,
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-watch": "~0.4.4",
"grunt-ember-handlebars": "*"
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.