0
My gulp:
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
imagemin = require('gulp-imagemin'),
changed = require('gulp-changed'),
browserSync = require('browser-sync'),
livereload = require('gulp-livereload');
gulp.task('sass', function () {
gulp.src('./assets/sass/*.scss')
.pipe(sass({compass: false}))
.on('error', function (err) { console.log(err.message); })
.pipe(gulp.dest('./dist/css'))
.pipe(livereload());
});
gulp.task('jpg', function() {
gulp.src('./assets/img/**/*.jpg')
.pipe(changed('./dist/img/'))
.pipe(imagemin({
progressive: true
}))
.pipe(gulp.dest('./dist/img/'));
});
gulp.task('browser-sync', function() {
browserSync.init(['./dist/css/**', './views/**'], {
server: {
baseDir: './',
index: './views/index.html'
}
});
});
gulp.task('watch', ['sass', 'browser-sync'], function () {
livereload.listen();
gulp.watch('./assets/sass/**/*.scss', ['sass']);
});
When I run, everything works, but SASS does not detect changes. Index.html works fine.
What could be wrong?
Thanks for the tip!
– Shelon
If the answer was helpful to you, I’d be happy if you could mark it as the right one.
– iszwnc
Marked :) and that’s what I did, it spun perfectly.
– Shelon