files/reveal.js/Gruntfile.js in reveal-ck-3.6.0 vs files/reveal.js/Gruntfile.js in reveal-ck-3.7.0

- old
+ new

@@ -1,19 +1,23 @@ /* global module:false */ module.exports = function(grunt) { var port = grunt.option('port') || 8000; + var root = grunt.option('root') || '.'; + + if (!Array.isArray(root)) root = [root]; + // Project configuration grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), meta: { banner: '/*!\n' + ' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' + ' * http://lab.hakim.se/reveal-js\n' + ' * MIT licensed\n' + ' *\n' + - ' * Copyright (C) 2015 Hakim El Hattab, http://hakim.se\n' + + ' * Copyright (C) 2017 Hakim El Hattab, http://hakim.se\n' + ' */' }, qunit: { files: [ 'test/*.html' ] @@ -34,23 +38,19 @@ files: { 'css/reveal.css': 'css/reveal.scss', } }, themes: { - files: { - 'css/theme/black.css': 'css/theme/source/black.scss', - 'css/theme/white.css': 'css/theme/source/white.scss', - 'css/theme/league.css': 'css/theme/source/league.scss', - 'css/theme/beige.css': 'css/theme/source/beige.scss', - 'css/theme/night.css': 'css/theme/source/night.scss', - 'css/theme/serif.css': 'css/theme/source/serif.scss', - 'css/theme/simple.css': 'css/theme/source/simple.scss', - 'css/theme/sky.css': 'css/theme/source/sky.scss', - 'css/theme/moon.css': 'css/theme/source/moon.scss', - 'css/theme/solarized.css': 'css/theme/source/solarized.scss', - 'css/theme/blood.css': 'css/theme/source/blood.scss' - } + files: [ + { + expand: true, + cwd: 'css/theme/source', + src: ['*.sass', '*.scss'], + dest: 'css/theme', + ext: '.css' + } + ] } }, autoprefixer: { dist: { @@ -69,10 +69,11 @@ jshint: { options: { curly: false, eqeqeq: true, immed: true, + esnext: true, latedef: true, newcap: true, noarg: true, sub: true, undef: true, @@ -93,47 +94,63 @@ connect: { server: { options: { port: port, - base: '.', - livereload: true, - open: true + base: root, + livereload: true, + open: true } - } + }, + }, zip: { 'reveal-js-presentation.zip': [ 'index.html', 'css/**', 'js/**', 'lib/**', 'images/**', - 'plugin/**' + 'plugin/**', + '**.md' ] }, watch: { - options: { - livereload: true - }, js: { files: [ 'Gruntfile.js', 'js/reveal.js' ], tasks: 'js' }, theme: { - files: [ 'css/theme/source/*.scss', 'css/theme/template/*.scss' ], + files: [ + 'css/theme/source/*.sass', + 'css/theme/source/*.scss', + 'css/theme/template/*.sass', + 'css/theme/template/*.scss' + ], tasks: 'css-themes' }, css: { files: [ 'css/reveal.scss' ], tasks: 'css-core' }, - html: { - files: [ 'index.html'] - } + html: { + files: root.map(path => path + '/*.html') + }, + markdown: { + files: root.map(path => path + '/*.md') + }, + options: { + livereload: true + } + }, + + retire: { + js: ['js/reveal.js', 'lib/js/*.js', 'plugin/**/*.js'], + node: ['.'], + options: {} } }); // Dependencies @@ -144,9 +161,10 @@ grunt.loadNpmTasks( 'grunt-contrib-watch' ); grunt.loadNpmTasks( 'grunt-sass' ); grunt.loadNpmTasks( 'grunt-contrib-connect' ); grunt.loadNpmTasks( 'grunt-autoprefixer' ); grunt.loadNpmTasks( 'grunt-zip' ); + grunt.loadNpmTasks( 'grunt-retire' ); // Default task grunt.registerTask( 'default', [ 'css', 'js' ] ); // JS task