-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
49 lines (41 loc) · 1006 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
40
41
42
43
44
45
46
47
48
49
var gulp = require('gulp');
var less = require('gulp-less');
var browserSync = require('browser-sync');
var paths = {
less: 'less/*.less',
html: '*.html'
};
gulp.task('less', function() {
gulp.src([ 'less/main.less', 'less/404.less' ])
.pipe(less({
paths: [ 'less' ]
}))
.pipe(gulp.dest('stylesheets'))
.pipe(browserSync.reload({stream:true}));
});
gulp.task('compass', function() {
gulp.src(paths.sass)
.pipe(compass({
css: 'stylesheets',
sass: 'sass'
}))
.pipe(browserSync.reload({stream:true}));
});
gulp.task('browser-sync', function() {
browserSync.init(null, {
server: {
baseDir: "./"
}
});
});
gulp.task('bs-reload', function() {
gulp.src(paths.html)
.pipe(browserSync.reload({stream:true}));
});
// Rerun the task when a file changes
gulp.task('watch', function() {
gulp.watch(paths.less, ['less']);
gulp.watch(paths.html, ['bs-reload']);
});
gulp.task('build', ['less']);
gulp.task('default', ['less', 'browser-sync', 'watch']);