forked from HerrBertling/slide-deck-hamburg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
71 lines (58 loc) · 1.72 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
var gulp = require("gulp");
var browserSync = require("browser-sync");
var reload = browserSync.reload;
var sass = require("gulp-sass");
var autoprefixer = require("gulp-autoprefixer");
var notify = require("gulp-notify");
var ghPages = require('gulp-gh-pages');
/*
* Opens a webserver (usually localhost:3000) and runs the site.
*/
gulp.task("browser-sync", function () {
browserSync({
server: {
baseDir: "./dist"
}
});
});
gulp.task('copy-assets', function() {
gulp.src([
'./assets/**'
])
.pipe(gulp.dest('./dist/assets'))
});
gulp.task('copy-html', function () {
gulp.src('./*.html')
.pipe(gulp.dest('./dist'))
});
gulp.task('copy-reveal', function () {
gulp.src('./reveal/**/*')
.pipe(gulp.dest('./dist/reveal'))
});
// Compiles your selected scss file, autoprefixes and minifies it and saves it to dist folder.
gulp.task("scss", function () {
gulp.src(["./scss/*.scss", "./reveal/css/theme/source/*.scss", "./reveal/css/reveal.scss"])
.pipe(sass({
onError: function (err) {
return notify().write(err);
}
}))
.pipe(autoprefixer("last 2 version", "ie 9"))
.pipe(gulp.dest("./dist/css"))
.pipe(reload({stream: true}));
});
gulp.task('serve', ['build'], function() {
browserSync({
server: {
baseDir: './dist'
}
});
gulp.watch(['./*.html', './scss/*.scss', './assets/*'], ['scss', 'copy']);
});
gulp.task('deploy', ['build'], function() {
return gulp.src('./dist/**/*')
.pipe(ghPages());
});
gulp.task('copy', ['copy-assets', 'copy-html', 'copy-reveal']);
gulp.task('build', ['copy', 'scss']);
gulp.task('default', ['build']);