-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
42 lines (36 loc) · 985 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
var gulp = require('gulp');
var sass = require('gulp-sass');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var paths = {
html: ['./app/*.html', './app/views/**/*.html'],
scripts: ['./app/scripts/**/*.js'],
sass: ['./app/css/scss/*.scss']
};
gulp.task('html', function() {
gulp.src(paths.html)
.pipe(reload({stream: true}));
});
gulp.task('scripts', function() {
gulp.src(paths.scripts)
.pipe(reload({stream: true}));
});
gulp.task('sass', function () {
gulp.src(paths.sass)
.pipe(sass({ errLogToConsole: true }))
.pipe(gulp.dest('./app/css'))
.pipe(reload({stream:true}));
});
// Static server
gulp.task('server', function() {
browserSync.init(null, {
server: {
baseDir: "./app"
}
});
});
gulp.task('default', ['sass', 'server'], function () {
gulp.watch(paths.html, ['html']);
gulp.watch(paths.scripts, ['scripts']);
gulp.watch(paths.sass, ['sass']);
});