Created
July 29, 2020 15:20
-
-
Save beatricebock/00dcbceccb6b798dce06b93e891c7827 to your computer and use it in GitHub Desktop.
Gulpfile that works for simple scss/html, Modified from this tutorial: https://themesberg.com/blog/tutorial/gulp-4-bootstrap-sass-browsersync
This file contains 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"); | |
var browserSync = require("browser-sync").create(); | |
var sass = require("gulp-sass"); | |
// Compile sass into CSS & auto-inject into browsers | |
gulp.task("sass", function () { | |
return gulp | |
.src("app/scss/**/*.scss") | |
.pipe(sass()) | |
.pipe(gulp.dest("app/css")) | |
.pipe(browserSync.stream()); | |
}); | |
// Static Server + watching scss/html files | |
gulp.task( | |
"serve", | |
gulp.series("sass", function () { | |
browserSync.init({ | |
server: "./app/", | |
}); | |
gulp | |
.watch("app/scss/**/*.scss", gulp.series("sass")) | |
.on("change", browserSync.reload); | |
gulp.watch("app/*.html").on("change", browserSync.reload); | |
}) | |
); | |
gulp.task("default", gulp.series("serve")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Following this tutorial: https://themesberg.com/blog/tutorial/gulp-4-bootstrap-sass-browsersync
changed lines 8, 23, 24