Skip to content

Commit 7c9b342

Browse files
committed
add package and serve grunt tasks (closes #437)
1 parent 0344f2f commit 7c9b342

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

Gruntfile.js

+28
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,26 @@ module.exports = function(grunt) {
7575
files: [ 'Gruntfile.js', 'js/reveal.js' ]
7676
},
7777

78+
connect: {
79+
server: {
80+
options: {
81+
port: 8000,
82+
base: '.'
83+
}
84+
}
85+
},
86+
87+
zip: {
88+
'reveal-js-presentation.zip': [
89+
'index.html',
90+
'css/**',
91+
'js/**',
92+
'lib/**',
93+
'images/**',
94+
'plugin/**'
95+
]
96+
},
97+
7898
watch: {
7999
main: {
80100
files: [ 'Gruntfile.js', 'js/reveal.js', 'css/reveal.css' ],
@@ -94,11 +114,19 @@ module.exports = function(grunt) {
94114
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
95115
grunt.loadNpmTasks( 'grunt-contrib-watch' );
96116
grunt.loadNpmTasks( 'grunt-contrib-sass' );
117+
grunt.loadNpmTasks( 'grunt-contrib-connect' );
118+
grunt.loadNpmTasks( 'grunt-zip' );
97119

98120
// Default task
99121
grunt.registerTask( 'default', [ 'jshint', 'cssmin', 'uglify' ] );
100122

101123
// Theme task
102124
grunt.registerTask( 'themes', [ 'sass' ] );
103125

126+
// Package presentation to archive
127+
grunt.registerTask( 'package', [ 'default', 'zip' ] );
128+
129+
// Serve presentation locally
130+
grunt.registerTask( 'serve', [ 'connect', 'watch' ] );
131+
104132
};

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
"grunt-contrib-uglify": "~0.1.1",
3333
"grunt-contrib-watch": "~0.2.0",
3434
"grunt-contrib-sass": "~0.2.2",
35+
"grunt-contrib-connect": "~0.2.0",
36+
"grunt-zip": "~0.7.0",
3537
"grunt": "~0.4.0"
3638
},
3739
"licenses": [

0 commit comments

Comments
 (0)