-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
53 lines (43 loc) · 1.18 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
#!/usr/bin/env node
// Gulpfile
require('colors');
require('chili-js');
// var coffee = require('gulp-coffee');
var gulp = require('gulp');
var sass = require('gulp-sass');
var gutil = require('gulp-util');
var browserSync = require('browser-sync').create();
gulp.task('default', function () {
// File watching
log(`Watching for changes`.yellow)
// Watch files and call the task
// gulp.watch('./coffee/**/*.coffee', ['coffee']);
gulp.watch('./sass/**/*.sass', ['sass']);
gulp.watch('./src/**/**', ['reload']);
// BrowserSync init :)
browserSync.init({
server: {
baseDir: "./src/"
}
});
});
// Convert CoffeeScript to JavaScript
// gulp.task('coffee', function() {
// gulp.src('./coffee/*.coffee')
// .pipe(coffee({bare: true}).on('error', gutil.log))
// .pipe(gulp.dest('./src/js/'))
// .pipe(browserSync.stream());
// log( `Coffee` );
// });
// Convert SASS to CSS
gulp.task('sass', function () {
gulp.src('./sass/*.sass')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./src/css'))
.pipe(browserSync.stream());
log( `SASS` );
});
// Reload the webpage
gulp.task('reload', function() {
browserSync.reload();
});