Gruntfile.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. module.exports = function(grunt) {
  2. grunt.initConfig({
  3. pkg: grunt.file.readJSON('package.json'),
  4. concat: {
  5. task: {
  6. src: ['source'],
  7. dest: 'destination'
  8. },
  9. options: {
  10. 'separator': grunt.util.linefeed,
  11. 'banner': '',
  12. 'footer': '',
  13. 'stripBanners': false,
  14. 'process': false,
  15. 'sourceMap': false,
  16. 'sourceMapName': undefined,
  17. 'sourceMapStyle': 'embed'
  18. }
  19. },
  20. uglify: {
  21. task: {
  22. src: ['app/js/*.js'],
  23. dest: 'dest/app.js'
  24. },
  25. options: {
  26. 'mangle': {},
  27. 'compress': {},
  28. 'beautify': false,
  29. 'expression': false,
  30. 'report': 'min',
  31. 'sourceMap': false,
  32. 'sourceMapName': undefined,
  33. 'sourceMapIn': undefined,
  34. 'sourceMapIncludeSources': false,
  35. 'enclose': undefined,
  36. 'wrap': undefined,
  37. 'exportAll': false,
  38. 'preserveComments': undefined,
  39. 'banner': '',
  40. 'footer': ''
  41. }
  42. },
  43. watch: {
  44. task: {
  45. src: ['source'],
  46. dest: 'destination'
  47. },
  48. options: {
  49. 'spawn': true,
  50. 'interrupt': false,
  51. 'debounceDelay': 500,
  52. 'interval': 100,
  53. 'event': 'all',
  54. 'reload': false,
  55. 'forever': true,
  56. 'dateFormat': null,
  57. 'atBegin': false,
  58. 'livereload': false,
  59. 'cwd': process.cwd(),
  60. 'livereloadOnError': true
  61. }
  62. },
  63. cssmin: {
  64. task: {
  65. src: ['source'],
  66. dest: 'destination'
  67. },
  68. options: {
  69. 'banner': null,
  70. 'keepSpecialComments': '*',
  71. 'report': 'min'
  72. }
  73. }
  74. });
  75. grunt.loadNpmTasks('grunt-contrib-concat');
  76. grunt.loadNpmTasks('grunt-contrib-uglify');
  77. grunt.loadNpmTasks('grunt-contrib-watch');
  78. grunt.loadNpmTasks('grunt-contrib-cssmin');
  79. grunt.registerTask('default', ['concat', 'uglify', 'watch', 'cssmin']);
  80. };