Guest User

Untitled

a guest
Jul 18th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. package.json
  2. dist/
  3. Gruntfile.js
  4. src/
  5. partials/
  6. partial.handlebars
  7. views/
  8. thing1.handlebars
  9. thing1.json
  10. thing2.handlebars
  11. thing2.json
  12.  
  13. module.exports = function(grunt) {
  14.  
  15. grunt.initConfig({
  16. jshint: {
  17. files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
  18. options: {
  19. globals: {
  20. jQuery: true
  21. }
  22. }
  23. },
  24. watch: {
  25. files: ['./src/*', './static/*'],
  26. tasks: ['compile-handlebars']
  27. },
  28. 'compile-handlebars': {
  29. compileRootTemplates: {
  30. files: [{
  31. expand: true,
  32. cwd: './src/views/',
  33. src: '*.handlebars',
  34. dest: './dist/',
  35. ext: '.html'
  36. }],
  37. templateData: './src/views/*.json',
  38. partials: './src/partials/*.handlebars'
  39. },
  40. });
  41.  
  42. grunt.loadNpmTasks('grunt-compile-handlebars');
  43. grunt.loadNpmTasks('grunt-contrib-watch');
  44.  
  45. grunt.registerTask('default', ['compile-handlebars']);
  46.  
  47. };
  48.  
  49. ...
  50. 'compile-handlebars': {
  51. compileRootTemplates: {
  52. files: [{
  53. expand: true,
  54. cwd: './src/templates/',
  55. src: '*.handlebars',
  56. dest: './dist/',
  57. ext: '.html'
  58. }],
  59. templateData: './src/data/*.json',
  60. partials: './src/partials/*.handlebars'
  61. },
  62. });
  63. ...
Add Comment
Please, Sign In to add comment