-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
40 lines (35 loc) · 936 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
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
var changed = require('gulp-changed');
var reload = browserSync.reload;
// var src = {
// scss: 'app/scss/*.scss',
// css: 'app/css',
// html: 'app/*.html'
// };
var src = {
scss: 'app/**/*.scss',
css: 'app/**/css',
js: 'app/**/*.js',
html: 'app/**/*.html'
};
// Static Server + watching scss/html files
gulp.task('serve', ['sass'], function() {
browserSync.init({
server: './app',
notify: false
});
gulp.watch(src.scss, ['sass']);
gulp.watch(src.js).on('change', reload);
gulp.watch(src.html).on('change', reload);
});
gulp.task('sass', function() {
return gulp
.src(src.scss, { base: './app' })
.pipe(sass().on('error', sass.logError))
.pipe(changed('./app'))
.pipe(gulp.dest('./app'))
.pipe(reload({ stream: true }));
});
gulp.task('default', ['serve']);