Created
March 23, 2021 11:06
-
-
Save pxdsgnco/39d5c78412b9aa369fbe83335418fab6 to your computer and use it in GitHub Desktop.
Minimal gulpfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'), | |
sass = require('gulp-sass'), | |
browserSync = require('browser-sync').create(); | |
//compile scss into css | |
function style() { | |
return gulp.src('src/scss/**/*.scss') | |
.pipe(sass().on('error',sass.logError)) | |
.pipe(gulp.dest('src/css')) | |
.pipe(browserSync.stream()); | |
} | |
function watch() { | |
browserSync.init({ | |
server: { | |
baseDir: "./src", | |
index: "/index.html" | |
} | |
}); | |
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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment