Skip to content

Instantly share code, notes, and snippets.

@bulv1ne
Created April 16, 2014 14:33
Show Gist options
  • Save bulv1ne/10885550 to your computer and use it in GitHub Desktop.
Save bulv1ne/10885550 to your computer and use it in GitHub Desktop.
angular html2js grunt
module.exports = function(grunt) {
grunt.initConfig({
html2js: {
options: {
base: ''
},
main: {
src: [ 'partials/*.html' ],
dest: 'js/templates.js'
}
},
watch: {
scripts: {
files: ['partials/*.html'],
tasks: ['html2js', 'notify:html2js'],
options: {
spawn: false,
},
},
},
notify: {
html2js: {
options: {
title: 'KB',
message: 'html2js compiled'
}
}
}
});
grunt.loadNpmTasks('grunt-html2js');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-notify');
grunt.registerTask('default', ['html2js']);
}
{
"devDependencies": {
"grunt": "^0.4.4",
"grunt-html2js": "^0.2.4",
"grunt-contrib-watch": "^0.6.1",
"grunt-notify": "^0.2.20"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment