files/reveal.js/Gruntfile.js in reveal-ck-0.5.1 vs files/reveal.js/Gruntfile.js in reveal-ck-0.6.0

- old
+ new

@@ -27,22 +27,20 @@ src: 'js/reveal.js', dest: 'js/reveal.min.js' } }, - cssmin: { - compress: { + sass: { + core: { files: { - 'css/reveal.min.css': [ 'css/reveal.css' ] + 'css/reveal.css': 'css/reveal.scss', } - } - }, - - sass: { - main: { + }, + themes: { files: { 'css/theme/default.css': 'css/theme/source/default.scss', + 'css/theme/black.css': 'css/theme/source/black.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', @@ -51,10 +49,24 @@ 'css/theme/blood.css': 'css/theme/source/blood.scss' } } }, + autoprefixer: { + dist: { + src: 'css/reveal.css' + } + }, + + cssmin: { + compress: { + files: { + 'css/reveal.min.css': [ 'css/reveal.css' ] + } + } + }, + jshint: { options: { curly: false, eqeqeq: true, immed: true, @@ -68,21 +80,25 @@ expr: true, globals: { head: false, module: false, console: false, - unescape: false + unescape: false, + define: false, + exports: false } }, files: [ 'Gruntfile.js', 'js/reveal.js' ] }, connect: { server: { options: { port: port, - base: '.' + base: '.', + livereload: true, + open: true } } }, zip: { @@ -95,36 +111,56 @@ 'plugin/**' ] }, watch: { - main: { - files: [ 'Gruntfile.js', 'js/reveal.js', 'css/reveal.css' ], - tasks: 'default' + options: { + livereload: true + }, + js: { + files: [ 'Gruntfile.js', 'js/reveal.js' ], + tasks: 'js' }, theme: { files: [ 'css/theme/source/*.scss', 'css/theme/template/*.scss' ], - tasks: 'themes' - } + tasks: 'css-themes' + }, + css: { + files: [ 'css/reveal.scss' ], + tasks: 'css-core' + }, + html: { + files: [ 'index.html'] + } } }); // Dependencies grunt.loadNpmTasks( 'grunt-contrib-qunit' ); grunt.loadNpmTasks( 'grunt-contrib-jshint' ); grunt.loadNpmTasks( 'grunt-contrib-cssmin' ); grunt.loadNpmTasks( 'grunt-contrib-uglify' ); grunt.loadNpmTasks( 'grunt-contrib-watch' ); - grunt.loadNpmTasks( 'grunt-contrib-sass' ); + grunt.loadNpmTasks( 'grunt-sass' ); grunt.loadNpmTasks( 'grunt-contrib-connect' ); + grunt.loadNpmTasks( 'grunt-autoprefixer' ); grunt.loadNpmTasks( 'grunt-zip' ); // Default task - grunt.registerTask( 'default', [ 'jshint', 'cssmin', 'uglify', 'qunit' ] ); + grunt.registerTask( 'default', [ 'css', 'js' ] ); - // Theme task - grunt.registerTask( 'themes', [ 'sass' ] ); + // JS task + grunt.registerTask( 'js', [ 'jshint', 'uglify', 'qunit' ] ); + + // Theme CSS + grunt.registerTask( 'css-themes', [ 'sass:themes' ] ); + + // Core framework CSS + grunt.registerTask( 'css-core', [ 'sass:core', 'autoprefixer', 'cssmin' ] ); + + // All CSS + grunt.registerTask( 'css', [ 'sass', 'autoprefixer', 'cssmin' ] ); // Package presentation to archive grunt.registerTask( 'package', [ 'default', 'zip' ] ); // Serve presentation locally