Guest User

Untitled

a guest
Dec 10th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. let gulp = require('gulp');
  2. let sass = require('gulp-sass');
  3. let browserSync = require('browser-sync');
  4.  
  5. gulp.task('styles', function() {
  6. return gulp.src('app/scss/*.scss')
  7. .pipe(sass())
  8. .pipe(gulp.dest('app/css')) //removed semicolon
  9. .pipe(browserSync.reload({ stream:true }));
  10. });
  11.  
  12. // watch Sass files for changes, run the Sass preprocessor with the 'sass' task and reload
  13. gulp.task('serve', gulp.series('styles', function() {
  14. browserSync({
  15. server: {
  16. baseDir: './app'
  17. }
  18. });
  19.  
  20. gulp.watch('app/scss/*.scss', gulp.series('styles'));
  21. gulp.watch('app/css/*.css', browserSync.reload);
  22. gulp.watch('app/**/*.html', browserSync.reload)
  23. }));
Add Comment
Please, Sign In to add comment