-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
25 lines (24 loc) · 724 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
const gulp = require('gulp');
const sass = require('gulp-sass');
const concat = require('gulp-concat');
const browserSync = require('browser-sync').create();
//compile scss into css
function style() {
return gulp.src('./styles/**/*.scss')
.pipe(concat('main.scss'))
.pipe(sass().on('error',sass.logError))
.pipe(gulp.dest('dist/css'))
.pipe(browserSync.stream());
}
function watch() {
browserSync.init({
server: {
baseDir: "./",
index: "/index.html"
}
});
gulp.watch('./styles/**/*.scss', style).on('change',browserSync.reload)
gulp.watch('./*.html').on('change',browserSync.reload);
}
exports.style = style;
exports.watch = watch;