-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
45 lines (37 loc) · 980 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
var gulp = require('gulp');
var compass = require('gulp-compass');
var browserSync = require('browser-sync');
var paths = {
sass: 'public/sass/**/*.scss',
css: 'public/css/*.css',
views: ['app/**/*.rb', 'app/views/**/*.haml']
};
gulp.task('compass', function() {
gulp.src(paths.sass)
.pipe(compass({
project: __dirname,
config_file: 'config.rb',
css: 'public/css',
sass: 'public/sass'
}));
});
gulp.task('inject', function() {
gulp.src(paths.css)
.pipe(browserSync.reload({stream:true}));
});
gulp.task('browser-sync', function() {
browserSync.init(null, {
open: false
});
});
gulp.task('bs-reload', function() {
gulp.src(paths.views)
.pipe(browserSync.reload({stream:true}));
});
// Rerun the task when a file changes
gulp.task('watch', function() {
gulp.watch(paths.sass, ['compass', 'inject']);
gulp.watch(paths.views, ['bs-reload']);
});
gulp.task('build', ['compass']);
gulp.task('default', ['browser-sync', 'watch']);