-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
36 lines (31 loc) · 1.08 KB
/
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
const gulp = require('gulp');
const sass = require('gulp-sass');
const browserSync = require('browser-sync');
//const rename = require('gulp-rename');
//compile scss into css
function style() {
// 1. Where is my cscc file
return gulp.src('./src/scss/**/*.scss')
// 2. Pass that file into the css compiler
.pipe(sass({
//Minified css
outputStyle : 'compressed'
}).on('error', sass.logError))//Rename file to .min.css .pipe(rename({ sufix: '.min'}))
// 3. Where do I save the compile css
.pipe(gulp.dest('./src'))
// 4. Stream Changes to all browsers
.pipe(browserSync.stream());
}
function watch() {
// browserSync.init({
// server: {
// baseDir: './'
// }
// });
// If a change happens on files then calls functions to refresh or reload
gulp.watch('./src/scss/**/*.scss', style);
//gulp.watch('./*.html').on('change', browserSync.reload);
//gulp.watch('./js/**/*.js').on('change', browserSync.reload);
}
exports.style = style;
exports.watch = watch;