forked from 1neye/instaClone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
36 lines (27 loc) · 850 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
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
var plumber = require('gulp-plumber');
gulp.task('sass', function(done) {
gulp.src("app/scss/*.scss") // путь к sass файлам
.pipe(plumber())
.pipe(sass())
.pipe(gulp.dest("app/css/")) //папка для выгрузки css файлов
.pipe(browserSync.stream());
done();
});
gulp.task('serve', function(done) {
browserSync.init({
server: {
baseDir: "app/"
},
files:['app/*.html','app/css/*.css']
});
gulp.watch("app/scss/*.scss", gulp.series('sass'));
gulp.watch("app/*.html").on('change', () => {
browserSync.reload();
done();
});
done();
});
gulp.task('default', gulp.series('sass', 'serve'));