-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
33 lines (27 loc) · 786 Bytes
/
gulpfile.js
File metadata and controls
33 lines (27 loc) · 786 Bytes
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
//'use strict';
const gulp = require('gulp');
const sass = require('gulp-sass');
const browserSync = require('browser-sync').create();
sass.compiler = require('node-sass');
//Compile our scss to css
function style() {
//Find our scss file
return gulp.src('./src/scss/**/*.scss')
//Pass that through our sass copiler and then compile in css
.pipe(sass())
.pipe(gulp.dest('./src/css'))
// Adding our stream changes for all browsers
.pipe(browserSync.stream());
}
function watch() {
browserSync.init({
server: {
baseDir: './'
}
});
gulp.watch('./src/scss/**/*.scss', style);
gulp.watch('./*.html').on('change', browserSync.reload);
gulp.watch('./src/js/**/*.js').on('change', browserSync.reload);
}
exports.style = style;
exports.watch = watch;