Gruntfile.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. module.exports = function(grunt) {
  2. "use strict";
  3. // Project configuration.
  4. grunt.initConfig({
  5. pkg: grunt.file.readJSON('package.json'),
  6. banner:
  7. '/*! Respond.js v<%= pkg.version %>: <%= pkg.description %>' +
  8. ' * Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
  9. ' * Licensed under <%= _.pluck(pkg.licenses, "url").join(", ") %>\n' +
  10. ' * <%= pkg.website %>' +
  11. ' */\n\n',
  12. uglify: {
  13. nonMinMatchMedia: {
  14. options: {
  15. mangle: false,
  16. compress: false,
  17. preserveComments: 'some',
  18. beautify: {
  19. beautify: true,
  20. indent_level: 2
  21. }
  22. },
  23. files: {
  24. 'dest/respond.src.js': ['src/matchmedia.polyfill.js', 'src/respond.js']
  25. }
  26. },
  27. minMatchMedia: {
  28. options: {
  29. banner: '<%= banner %>'
  30. },
  31. files: {
  32. 'dest/respond.min.js': ['src/matchmedia.polyfill.js', 'src/respond.js']
  33. }
  34. },
  35. nonMinMatchMediaListener: {
  36. options: {
  37. mangle: false,
  38. compress: false,
  39. preserveComments: 'some',
  40. beautify: {
  41. beautify: true,
  42. indent_level: 2
  43. }
  44. },
  45. files: {
  46. 'dest/respond.matchmedia.addListener.src.js': ['src/matchmedia.polyfill.js', 'src/matchmedia.addListener.js', 'src/respond.js']
  47. }
  48. },
  49. minMatchMediaListener: {
  50. options: {
  51. banner: '<%= banner %>'
  52. },
  53. files: {
  54. 'dest/respond.matchmedia.addListener.min.js': ['src/matchmedia.polyfill.js', 'src/matchmedia.addListener.js', 'src/respond.js']
  55. }
  56. }
  57. },
  58. jshint: {
  59. files: ['src/respond.js', 'src/matchmedia.polyfill.js'],
  60. options: {
  61. curly: true,
  62. eqeqeq: true,
  63. immed: true,
  64. latedef: false,
  65. newcap: true,
  66. noarg: true,
  67. sub: true,
  68. undef: true,
  69. boss: true,
  70. eqnull: true,
  71. smarttabs: true,
  72. node: true,
  73. es5: true,
  74. strict: false
  75. },
  76. globals: {
  77. Image: true,
  78. window: true
  79. }
  80. }
  81. });
  82. grunt.loadNpmTasks( 'grunt-contrib-jshint' );
  83. grunt.loadNpmTasks( 'grunt-contrib-uglify' );
  84. // Default task.
  85. grunt.registerTask('default', ['jshint', 'uglify']);
  86. };