-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
29 lines (26 loc) · 892 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
// include gulp and required plugins
var gulp = require('gulp');
var sass = require('gulp-sass');
var browserSync = require('browser-sync');
var notify = require('gulp-notify');
// compile sass and check for errors
gulp.task('compile-sass', function() {
gulp.src('assets/sass/**/*.scss')
.pipe(sass({ outputStyle: 'compressed' }))
.on("error", notify.onError(function (error) {
return "Dang! " + error.message;
}))
.pipe(gulp.dest('assets/css'))
});
// start a server and watch for html, css and js changes
gulp.task('browser-sync', function() {
browserSync.init(["assets/css/*.css", "*.html", "assets/js/*.js"], {
server: {
baseDir: "./"
}
});
});
// watch for changes
gulp.task('default', ['compile-sass', 'browser-sync'], function () {
gulp.watch("assets/sass/**/*.scss", ['compile-sass']);
});