node -v v11.9.0
gulp -v
[23:31:30] CLI version 2.0.1
[23:31:30] Local version 4.0.0
Не коректно работает, нет изменений в css, при сохранении sass
const gulp = require('gulp');
const sass = require('gulp-sass');
const plumber = require('gulp-plumber');
const autoprefixer = require('gulp-autoprefixer');
const browserSync = require("browser-sync").create();
function style() {
return (
gulp.src("./src/sass/style.sass")
.pipe(plumber())
.pipe(sass()).on("error", sass.logError)
.pipe(autoprefixer())
.pipe(gulp.dest("./src/css/style.css"))
.pipe(browserSync.stream())
);
}
function reload() {
browserSync.reload();
}
function watch() {
browserSync.init({
server: {
baseDir: "./src"
}
});
gulp.watch("src/sass/*.sass").on('change', browserSync.reload);
gulp.watch("src/*.html").on('change', browserSync.reload);
}
exports.style = style;
exports.reload = reload;
exports.watch = watch;