-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
39 lines (32 loc) · 898 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
35
36
37
38
39
// Include gulp
var gulp = require('gulp');
// Include Plugins
var browserSync = require('browser-sync');
var sass = require('gulp-sass');
// Static server
gulp.task('browserSync', function()
{
browserSync({
server: {
baseDir: 'dist'
}
})
});
// Compile Sass files
gulp.task('sass', function()
{
gulp.src('src/_examples/*.scss')
.pipe(sass().on('error', sass.logError)) // This option handles sass errors :-)
.pipe(gulp.dest('dist/_examples/'))
.pipe(browserSync.stream({
once: true
}));
});
// Watch Files For Changes then reload Browser
gulp.task('watch', ['browserSync', 'sass'], function ()
{
gulp.watch('src/**/*.scss', ['sass']);
gulp.watch('dist/_examples/*.html').on('change', browserSync.reload);
});
// Default Task
gulp.task('default', ['sass', 'browserSync', 'watch']);