Created
February 23, 2018 09:47
-
-
Save ixahmedxi/d347eb52c4754cedd82ad4beb68578e5 to your computer and use it in GitHub Desktop.
Gulp Browser Sync with sass compiling
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
const gulp = require('gulp') | |
const browserSync = require('browser-sync').create() | |
gulp.task('browser-sync', ['sass'], () => { | |
browserSync.init({ | |
server: { | |
baseDir: "./" | |
} | |
}) | |
// watch the scss files for change to reload the server | |
gulp.watch("app/scss/*.scss", ['sass']) | |
}) | |
gulp.task('sass', function() { | |
return gulp.src("app/scss/*.scss") | |
.pipe(sass()) | |
.pipe(gulp.dest("app/css")) | |
.pipe(browserSync.stream()) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment