gulp.task('scss-blocks', function () {
return gulp.src(paths.src + 'scss/blocks/*.scss')
.pipe(cached('sass'))
.pipe(dependents())
.pipe(sourcemaps.init())
.pipe(sass())
.on("error", sass.logError)
.pipe(sourcemaps.write())
.pipe(gulp.dest(function(vinyl) {
return 'blocks/' + filename;
}))
.pipe(browserSync.stream())
});
npm i
gulp.task('build',['clean', 'copy', 'style', 'sprite', 'html']);
gulp.task("serve", function () {
browserSync.init({
server: "dev"
});
gulp.watch("src/scss/*.scss", ["dev:scss"]);
gulp.watch("src/**/*.html", ["dev:html"]);
gulp.watch("src/js/*.js", ["dev:js"]);
gulp.watch("src/js/libs/*.js", ["dev:js-libs"]);
gulp.watch("dev/*.html").on("change", browserSync.reload);
gulp.watch("dev/js/*.js").on("change", browserSync.reload);
gulp.watch("dev/**/*.css").on("change", browserSync.reload);
});