Answer the question
In order to leave comments, you need to log in
Why is gulp sass not updating css?
gulp.task('sass', function() { // Создаем таск Sass
return gulp.src(['src/wp-content/themes/ninazvereva/sass/**/*.sass',
'src/wp-content/themes/ninazvereva/sass/**/*.scss']) // Берем источник
.pipe(sass().on('error', sass.logError))
.pipe(sass()) // Преобразуем Sass в CSS посредством gulp-sass
.pipe(autoprefixer(['last 15 versions', '> 1%', 'ie 8', 'ie 7'], { cascade: true })) // Создаем префиксы
.pipe(gulp.dest('src/wp-content/themes/ninazvereva/css')) // Выгружаем результата в папку app/css
.pipe(browserSync.reload({stream: true})) // Обновляем CSS на странице при изменении
});
gulp.task('watch', function() {
gulp.watch(['src/wp-content/themes/ninazvereva/sass/**/*.sass','src/wp-content/themes/ninazvereva/sass/**/*.scss'], gulp.parallel('sass')); // Наблюдение за sass файлами в папке sass в теме
gulp.watch('src/wp-content/themes/ninazvereva/**/*.php', gulp.parallel('code'));
gulp.watch('src/wp-content/themes/ninazvereva/js/common.js', gulp.parallel('scripts')); // Наблюдение за главным JS файлом и за библиотеками
});
[14:26:07] Starting 'sass'...
[Browsersync] 2 files changed (libs.css, styles.css)
[14:26:09] Finished 'sass' after 2.17 s
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question