Answer the question
In order to leave comments, you need to log in
Changes in the css file through Gulp are not displayed - how to do it?
var gulp = require('gulp'),
sass = require('gulp-sass'),
browserSync = require('browser-sync');
gulp.task('sass', function() {
return gulp.src('app/sass/main.sass')
.pipe(sass())
.pipe(gulp.dest('app/css'))
.pipe(browserSync.reload({stream: true}))
});
gulp.task('watch', ['browser-sync', 'sass'], function() {
gulp.watch('app/sass/main.sass', ['sass']);
gulp.watch('app/*.html', browserSync.reload)
gulp.watch('app/js/**/*.js', browserSync.reload)
});
gulp.task('browser-sync', function() {
browserSync({
server: {
baseDir: 'app'
},
notify: false
});
});
Answer the question
In order to leave comments, you need to log in
You just had to write the default gulp.watch gulp task and specify all the SASS or LESS files (which ones you use):gulp.watch("app/sass/**/*.sass", ["sass"]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question