Add note to README about how to disable scaling
[git-branching.git] / Gruntfile.js
blob87630d5012c7d81a520338588e0ee7ca873f6b04
1 /* global module:false */
2 module.exports = function(grunt) {
3 var port = grunt.option('port') || 8000;
4 var base = grunt.option('base') || '.';
6 // Project configuration
7 grunt.initConfig({
8 pkg: grunt.file.readJSON('package.json'),
9 meta: {
10 banner:
11 '/*!\n' +
12 ' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' +
13 ' * http://lab.hakim.se/reveal-js\n' +
14 ' * MIT licensed\n' +
15 ' *\n' +
16 ' * Copyright (C) 2016 Hakim El Hattab, http://hakim.se\n' +
17 ' */'
20 qunit: {
21 files: [ 'test/*.html' ]
24 uglify: {
25 options: {
26 banner: '<%= meta.banner %>\n'
28 build: {
29 src: 'js/reveal.js',
30 dest: 'js/reveal.min.js'
34 sass: {
35 core: {
36 files: {
37 'css/reveal.css': 'css/reveal.scss',
40 themes: {
41 files: [
43 expand: true,
44 cwd: 'css/theme/source',
45 src: ['*.scss'],
46 dest: 'css/theme',
47 ext: '.css'
53 autoprefixer: {
54 dist: {
55 src: 'css/reveal.css'
59 cssmin: {
60 compress: {
61 files: {
62 'css/reveal.min.css': [ 'css/reveal.css' ]
67 jshint: {
68 options: {
69 curly: false,
70 eqeqeq: true,
71 immed: true,
72 latedef: true,
73 newcap: true,
74 noarg: true,
75 sub: true,
76 undef: true,
77 eqnull: true,
78 browser: true,
79 expr: true,
80 globals: {
81 head: false,
82 module: false,
83 console: false,
84 unescape: false,
85 define: false,
86 exports: false
89 files: [ 'Gruntfile.js', 'js/reveal.js' ]
92 connect: {
93 server: {
94 options: {
95 port: port,
96 base: base,
97 livereload: true,
98 open: true
103 zip: {
104 'reveal-js-presentation.zip': [
105 'index.html',
106 'css/**',
107 'js/**',
108 'lib/**',
109 'images/**',
110 'plugin/**',
111 '**.md'
115 watch: {
116 js: {
117 files: [ 'Gruntfile.js', 'js/reveal.js' ],
118 tasks: 'js'
120 theme: {
121 files: [ 'css/theme/source/*.scss', 'css/theme/template/*.scss' ],
122 tasks: 'css-themes'
124 css: {
125 files: [ 'css/reveal.scss' ],
126 tasks: 'css-core'
128 html: {
129 files: [ '*.html']
131 markdown: {
132 files: [ '*.md' ]
134 options: {
135 livereload: true
141 // Dependencies
142 grunt.loadNpmTasks( 'grunt-contrib-qunit' );
143 grunt.loadNpmTasks( 'grunt-contrib-jshint' );
144 grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
145 grunt.loadNpmTasks( 'grunt-contrib-uglify' );
146 grunt.loadNpmTasks( 'grunt-contrib-watch' );
147 grunt.loadNpmTasks( 'grunt-sass' );
148 grunt.loadNpmTasks( 'grunt-contrib-connect' );
149 grunt.loadNpmTasks( 'grunt-autoprefixer' );
150 grunt.loadNpmTasks( 'grunt-zip' );
152 // Default task
153 grunt.registerTask( 'default', [ 'css', 'js' ] );
155 // JS task
156 grunt.registerTask( 'js', [ 'jshint', 'uglify', 'qunit' ] );
158 // Theme CSS
159 grunt.registerTask( 'css-themes', [ 'sass:themes' ] );
161 // Core framework CSS
162 grunt.registerTask( 'css-core', [ 'sass:core', 'autoprefixer', 'cssmin' ] );
164 // All CSS
165 grunt.registerTask( 'css', [ 'sass', 'autoprefixer', 'cssmin' ] );
167 // Package presentation to archive
168 grunt.registerTask( 'package', [ 'default', 'zip' ] );
170 // Serve presentation locally
171 grunt.registerTask( 'serve', [ 'connect', 'watch' ] );
173 // Run tests
174 grunt.registerTask( 'test', [ 'jshint', 'qunit' ] );