Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. module.exports = function (grunt) {
  2. // Project configuration.
  3. grunt.initConfig({
  4. pkg: grunt.file.readJSON('package.json'),
  5. jade: {
  6. compile: {
  7. options: {
  8. data: {
  9. debug: true,
  10. timestamp: "<%= new Date().getTime() %>"
  11. }
  12. },
  13. files: [{
  14. expand: true,
  15. src: '**/*.jade',
  16. ext : '.html'
  17. }]
  18. }
  19. },
  20. uglify: {
  21. options: {
  22. banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
  23. },
  24. build: {
  25. src: 'Scripts/bootstrap.js',
  26. dest: 'Scripts/build/bootstrap.min.js'
  27. }
  28. },
  29. watch: {
  30. jade: {
  31. files: '**/*.jade',
  32. tasks: ['jade:watch'],
  33. options: {
  34. spawn: false
  35. }
  36. }
  37. }
  38. });
  39.  
  40.  
  41.  
  42. grunt.event.on('watch', function (action, filepath) {
  43. if (filepath.indexOf('.jade') === -1) return;
  44. var file = {};
  45. var destfile = filepath.replace('.jade', '.html');
  46. file[destfile] = filepath
  47. grunt.config('jade.watch.files', file);
  48. });
  49.  
  50. grunt.loadNpmTasks('grunt-contrib-watch');
  51. // Load the plugin that provides the "uglify" task.
  52. grunt.loadNpmTasks('grunt-contrib-uglify');
  53.  
  54. grunt.loadNpmTasks('grunt-contrib-jade');
  55. // Default task(s).
  56. grunt.registerTask('default', ['uglify']);
  57. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement