Gruntfile.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. sass: {
  40. main: {
  41. files: {
  42. 'css/theme/default.css': 'css/theme/source/default.scss',
  43. 'css/theme/beige.css': 'css/theme/source/beige.scss',
  44. 'css/theme/night.css': 'css/theme/source/night.scss',
  45. 'css/theme/serif.css': 'css/theme/source/serif.scss',
  46. 'css/theme/simple.css': 'css/theme/source/simple.scss',
  47. 'css/theme/sky.css': 'css/theme/source/sky.scss',
  48. 'css/theme/moon.css': 'css/theme/source/moon.scss',
  49. 'css/theme/solarized.css': 'css/theme/source/solarized.scss'
  50. }
  51. },
  52. },
  53. jshint: {
  54. options: {
  55. curly: false,
  56. eqeqeq: true,
  57. immed: true,
  58. latedef: true,
  59. newcap: true,
  60. noarg: true,
  61. sub: true,
  62. undef: true,
  63. eqnull: true,
  64. browser: true,
  65. expr: true
  66. },
  67. globals: {
  68. head: false,
  69. module: false,
  70. console: false
  71. }
  72. },
  73. watch: {
  74. main: {
  75. files: [ 'Gruntfile.js', 'js/reveal.js', 'css/reveal.css' ],
  76. tasks: 'default'
  77. },
  78. theme: {
  79. files: [ 'css/theme/source/*.scss', 'css/theme/template/*.scss' ],
  80. tasks: 'themes'
  81. }
  82. }
  83. });
  84. // Dependencies
  85. grunt.loadNpmTasks( 'grunt-contrib-jshint' );
  86. grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
  87. grunt.loadNpmTasks( 'grunt-contrib-uglify' );
  88. grunt.loadNpmTasks( 'grunt-contrib-watch' );
  89. grunt.loadNpmTasks( 'grunt-contrib-sass' );
  90. // Default task
  91. grunt.registerTask( 'default', [ 'jshint', 'cssmin', 'uglify' ] );
  92. // Theme task
  93. grunt.registerTask( 'themes', [ 'sass' ] );
  94. };