Created
September 14, 2017 09:13
-
-
Save mareksl/731628ff230463af1743df02a03c60bc to your computer and use it in GitHub Desktop.
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'); | |
gulp.task('browser-sync', ['sass'], function() { | |
browserSync.init({ | |
server: "app", | |
port: 8080, | |
}); | |
gulp.watch('app/scss/**/*.scss', ['sass']); | |
gulp.watch("app/*.html").on('change', browserSync.reload); | |
}); | |
gulp.task('sass', function() { | |
return gulp.src('app/scss/styles.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