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