Skip to content

Instantly share code, notes, and snippets.

@beatricebock
Created July 29, 2020 15:20
Show Gist options
  • Save beatricebock/00dcbceccb6b798dce06b93e891c7827 to your computer and use it in GitHub Desktop.
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
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"));
@beatricebock
Copy link
Author

Following this tutorial: https://themesberg.com/blog/tutorial/gulp-4-bootstrap-sass-browsersync

changed lines 8, 23, 24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment