GruntFile.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. module.exports = function(grunt) {
  2. grunt.initConfig({
  3. pkg: grunt.file.readJSON('package.json'),
  4. meta: {
  5. banner: '/*!\n' +
  6. ' * <%= pkg.name %> v<%= pkg.version %> - <%= pkg.description %>\n' +
  7. ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> - <%= pkg.homepage %>\n' +
  8. ' * License: <%= pkg.license %>\n' +
  9. ' */\n\n'
  10. },
  11. rig: {
  12. options: {
  13. banner: '<%= meta.banner %>'
  14. },
  15. dist: {
  16. files: {
  17. 'dist/datepair.js': ['src/wrapper.js'],
  18. 'dist/jquery.datepair.js' : ['src/jquery.datepair.js'],
  19. }
  20. }
  21. },
  22. uglify: {
  23. options: {
  24. banner: '<%= meta.banner %>',
  25. report: 'min'
  26. },
  27. dist: {
  28. files: {
  29. 'dist/datepair.min.js': 'dist/datepair.js',
  30. 'dist/jquery.datepair.min.js': ['dist/datepair.js', 'dist/jquery.datepair.js'],
  31. }
  32. }
  33. },
  34. jshint: {
  35. all: ['src/*.js']
  36. },
  37. watch: {
  38. options : {
  39. atBegin : true
  40. },
  41. files: ['src/*.js'],
  42. tasks: ['rig']
  43. }
  44. });
  45. grunt.loadNpmTasks('grunt-contrib-uglify');
  46. grunt.loadNpmTasks('grunt-rigger');
  47. grunt.loadNpmTasks('grunt-contrib-watch');
  48. grunt.loadNpmTasks('grunt-contrib-jshint');
  49. grunt.registerTask('default', ['rig', 'uglify']);
  50. };