forked from MatejKustec/SpinThatShit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
34 lines (28 loc) · 885 Bytes
/
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
'use strict';
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
var plumber = require('gulp-plumber');
// Static Server + watching scss/html files
gulp.task('serve', ['sass'], function() {
browserSync.init({
server: "./examples"
});
gulp.watch("./examples/scss/**/*.scss", ['sass']);
gulp.watch("./examples/*.html").on('change', browserSync.reload);
});
// Compile sass into CSS & auto-inject into browsers
gulp.task('sass', function() {
return gulp.src("./examples/scss/**/*.scss")
.pipe(plumber({
errorHandler: function(error) {
console.log(error.message);
this.emit('end');
}
}))
.pipe(sass())
.pipe(plumber.stop())
.pipe(gulp.dest("examples"))
.pipe(browserSync.stream());
});
gulp.task('default', ['serve']);