gruntfile.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* global module:false */
  2. module.exports = function(grunt) {
  3. // Project configuration
  4. grunt.initConfig({
  5. pkg: grunt.file.readJSON('package.json'),
  6. meta: {
  7. banner:
  8. '/*!\n' +
  9. ' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' +
  10. ' * http://lab.hakim.se/reveal-js\n' +
  11. ' * MIT licensed\n' +
  12. ' *\n' +
  13. ' * Copyright (C) 2013 Hakim El Hattab, http://hakim.se\n' +
  14. ' */'
  15. },
  16. jshint: {
  17. files: [ 'gruntfile.js', 'js/reveal.js' ]
  18. },
  19. // Tests will be added soon
  20. qunit: {
  21. files: [ 'test/**/*.html' ]
  22. },
  23. uglify: {
  24. options: {
  25. banner: '<%= meta.banner %>\n'
  26. },
  27. build: {
  28. src: 'js/reveal.js',
  29. dest: 'js/reveal.min.js'
  30. }
  31. },
  32. cssmin: {
  33. compress: {
  34. files: {
  35. 'css/reveal.min.css': [ 'css/reveal.css' ]
  36. }
  37. }
  38. },
  39. jshint: {
  40. options: {
  41. curly: false,
  42. eqeqeq: true,
  43. immed: true,
  44. latedef: true,
  45. newcap: true,
  46. noarg: true,
  47. sub: true,
  48. undef: true,
  49. eqnull: true,
  50. browser: true,
  51. expr: true
  52. },
  53. globals: {
  54. head: false,
  55. module: false,
  56. console: false
  57. }
  58. },
  59. watch: {
  60. files: [ 'gruntfile.js', 'js/reveal.js', 'css/reveal.css' ],
  61. tasks: 'default'
  62. }
  63. });
  64. // Dependencies
  65. grunt.loadNpmTasks( 'grunt-contrib-jshint' );
  66. grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
  67. grunt.loadNpmTasks( 'grunt-contrib-uglify' );
  68. grunt.loadNpmTasks( 'grunt-contrib-watch' );
  69. // Default task
  70. grunt.registerTask( 'default', [ 'jshint', 'cssmin', 'uglify' ] );
  71. };