forked from azouaoui-med/pro-sidebar-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
32 lines (25 loc) · 835 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
'use strict';
const gulp = require('gulp');
const sass = require('gulp-sass');
const browserSync = require('browser-sync').create();
const autoprefixer = require('gulp-autoprefixer');
sass.compiler = require('node-sass');
gulp.task('sass', function () {
return gulp.src(['./src/sass/**/*.scss'])
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest('./src/css'))
.pipe(browserSync.stream());
});
gulp.task('serve', function() {
browserSync.init({
server: ["./","./src"]
});
gulp.watch("./src/sass/**/*.scss", gulp.series('sass'));
gulp.watch("./src/**/*.js").on('change', browserSync.reload);
gulp.watch("./src/*.html").on('change', browserSync.reload);
});
gulp.task('default', gulp.series('serve'));