Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package.json
- dist/
- Gruntfile.js
- src/
- partials/
- partial.handlebars
- views/
- thing1.handlebars
- thing1.json
- thing2.handlebars
- thing2.json
- module.exports = function(grunt) {
- grunt.initConfig({
- jshint: {
- files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
- options: {
- globals: {
- jQuery: true
- }
- }
- },
- watch: {
- files: ['./src/*', './static/*'],
- tasks: ['compile-handlebars']
- },
- 'compile-handlebars': {
- compileRootTemplates: {
- files: [{
- expand: true,
- cwd: './src/views/',
- src: '*.handlebars',
- dest: './dist/',
- ext: '.html'
- }],
- templateData: './src/views/*.json',
- partials: './src/partials/*.handlebars'
- },
- });
- grunt.loadNpmTasks('grunt-compile-handlebars');
- grunt.loadNpmTasks('grunt-contrib-watch');
- grunt.registerTask('default', ['compile-handlebars']);
- };
- ...
- 'compile-handlebars': {
- compileRootTemplates: {
- files: [{
- expand: true,
- cwd: './src/templates/',
- src: '*.handlebars',
- dest: './dist/',
- ext: '.html'
- }],
- templateData: './src/data/*.json',
- partials: './src/partials/*.handlebars'
- },
- });
- ...
Add Comment
Please, Sign In to add comment