-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
75 lines (65 loc) · 1.67 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var cssmin = require('gulp-cssmin');
var rename = require("gulp-rename");
var uglify = require('gulp-uglify');
var qunit = require('gulp-qunit');
var sass = require('gulp-sass');
var zip = require('gulp-zip');
var connect = require('gulp-connect');
//Define individual tasks
gulp.task('jshint', function(){
return gulp.src([ 'Gruntfile.js', 'js/reveal.js' ])
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('cssmin', function(){
return gulp.src('css/reveal.css')
.pipe(cssmin())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('css'));
});
gulp.task('uglify', function(){
return gulp.src('js/reveal.js')
.pipe(uglify())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('js'));
});
gulp.task('qunit', function(){
return gulp.src('test/*.html')
.pipe(qunit());
});
gulp.task('sass', function(){
return gulp.src('css/theme/source/*.scss')
.pipe(sass())
.pipe(gulp.dest('css/theme'));
});
gulp.task('zip', function(){
return gulp.src([
'index.html',
'css/**',
'js/**',
'lib/**',
'images/**',
'plugin/**'])
.pipe(zip('reveal-js-presentation.zip'))
.pipe(gulp.dest('dist'));
});
gulp.task('connect', function(){
connect.server({
root: '.',
livereload: true
});
});
gulp.task('html', function () {
gulp.src('./*.html')
.pipe(connect.reload());
});
gulp.task('watch', function () {
gulp.watch(['./*.html', 'css/*.css'], ['html']);
});
//Define aggregate tasks
gulp.task('default', ['jshint', 'cssmin', 'uglify', 'qunit']);
gulp.task('package', ['default', 'zip']);
gulp.task('serve', ['default', 'connect', 'watch']);
gulp.task('test', ['jshint', 'qunit']);