reduce grunt task overhead

This commit is contained in:
Hakim El Hattab 2014-10-06 09:51:12 +02:00
parent cc02564b2f
commit a3a2ad039e

View File

@ -30,9 +30,13 @@ module.exports = function(grunt) {
}, },
sass: { sass: {
dist: { core: {
files: { files: {
'css/reveal.css': 'css/reveal.scss', 'css/reveal.css': 'css/reveal.scss',
}
},
themes: {
files: {
'css/theme/default.css': 'css/theme/source/default.scss', 'css/theme/default.css': 'css/theme/source/default.scss',
'css/theme/black.css': 'css/theme/source/black.scss', 'css/theme/black.css': 'css/theme/source/black.scss',
'css/theme/beige.css': 'css/theme/source/beige.scss', 'css/theme/beige.css': 'css/theme/source/beige.scss',
@ -112,17 +116,17 @@ module.exports = function(grunt) {
options: { options: {
livereload: true livereload: true
}, },
main: { js: {
files: [ 'Gruntfile.js', 'js/reveal.js', 'css/reveal.css' ], files: [ 'Gruntfile.js', 'js/reveal.js' ],
tasks: 'default' tasks: 'js'
}, },
theme: { theme: {
files: [ 'css/theme/source/*.scss', 'css/theme/template/*.scss' ], files: [ 'css/theme/source/*.scss', 'css/theme/template/*.scss' ],
tasks: 'themes' tasks: 'css-themes'
}, },
css: { css: {
files: [ 'css/reveal.css' ], files: [ 'css/reveal.scss' ],
tasks: 'css' tasks: 'css-core'
}, },
html: { html: {
files: [ 'index.html'] files: [ 'index.html']
@ -143,12 +147,18 @@ module.exports = function(grunt) {
grunt.loadNpmTasks( 'grunt-zip' ); grunt.loadNpmTasks( 'grunt-zip' );
// Default task // Default task
grunt.registerTask( 'default', [ 'jshint', 'css', 'uglify', 'qunit' ] ); grunt.registerTask( 'default', [ 'css', 'js' ] );
// Theme task // JS task
grunt.registerTask( 'themes', [ 'sass' ] ); grunt.registerTask( 'js', [ 'jshint', 'uglify', 'qunit' ] );
// CSS task // 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' ] ); grunt.registerTask( 'css', [ 'sass', 'autoprefixer', 'cssmin' ] );
// Package presentation to archive // Package presentation to archive