aboutsummaryrefslogtreecommitdiffhomepage
path: root/Gruntfile.js
diff options
context:
space:
mode:
Diffstat (limited to 'Gruntfile.js')
-rw-r--r--Gruntfile.js85
1 files changed, 60 insertions, 25 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index 1baf966..a851845 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,6 +1,8 @@
/* global module:false */
module.exports = function(grunt) {
var port = grunt.option('port') || 8000;
+ var base = grunt.option('base') || '.';
+
// Project configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
@@ -11,7 +13,7 @@ module.exports = function(grunt) {
' * http://lab.hakim.se/reveal-js\n' +
' * MIT licensed\n' +
' *\n' +
- ' * Copyright (C) 2014 Hakim El Hattab, http://hakim.se\n' +
+ ' * Copyright (C) 2015 Hakim El Hattab, http://hakim.se\n' +
' */'
},
@@ -29,26 +31,35 @@ module.exports = function(grunt) {
}
},
- cssmin: {
- compress: {
+ sass: {
+ core: {
files: {
- 'css/reveal.min.css': [ 'css/reveal.css' ]
+ 'css/reveal.css': 'css/reveal.scss',
}
+ },
+ themes: {
+ files: [
+ {
+ expand: true,
+ cwd: 'css/theme/source',
+ src: ['*.scss'],
+ dest: 'css/theme',
+ ext: '.css'
+ }
+ ]
}
},
- sass: {
- main: {
+ autoprefixer: {
+ dist: {
+ src: 'css/reveal.css'
+ }
+ },
+
+ cssmin: {
+ compress: {
files: {
- 'css/theme/default.css': 'css/theme/source/default.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'
+ 'css/reveal.min.css': [ 'css/reveal.css' ]
}
}
},
@@ -70,7 +81,9 @@ module.exports = function(grunt) {
head: false,
module: false,
console: false,
- unescape: false
+ unescape: false,
+ define: false,
+ exports: false
}
},
files: [ 'Gruntfile.js', 'js/reveal.js' ]
@@ -80,7 +93,9 @@ module.exports = function(grunt) {
server: {
options: {
port: port,
- base: '.'
+ base: base,
+ livereload: true,
+ open: true
}
}
},
@@ -97,13 +112,23 @@ module.exports = function(grunt) {
},
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']
}
}
@@ -115,15 +140,25 @@ module.exports = function(grunt) {
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' ] );
+
+ // 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' ] );
- // Theme task
- grunt.registerTask( 'themes', [ 'sass' ] );
+ // All CSS
+ grunt.registerTask( 'css', [ 'sass', 'autoprefixer', 'cssmin' ] );
// Package presentation to archive
grunt.registerTask( 'package', [ 'default', 'zip' ] );