-
-
Save nikita007899/42b3fa27825f19b173a0d285b77fea1c to your computer and use it in GitHub Desktop.
gulp trouble
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'), | |
sass = require('gulp-sass'), | |
browserSync = require('browser-sync'); /* подключение модуля, который устанавливается через npm install*/ | |
gulp.task('sass', function() { | |
return gulp.src('app/sass/**/*.sass') | |
.pipe(sass()) | |
.pipe(gulp.dest('app/css')) /* только папки, не указывать отдельные файлы*/ | |
.pipe(browserSync.reload({stream: true})) /* обновление без перезагрузки */ | |
}); | |
gulp.task('browser-sync', function() { | |
browserSync.init({ | |
server: 'app', | |
}); | |
browserSync.watch('app/**/*.*').on('change', browserSync.reload); | |
}); | |
gulp.task('watch', gulp.series('browser-sync', 'sass'), function() { | |
gulp.watch('app/sass/**/*.sass', gulp.series('sass')); | |
gulp.watch('app/*.html', browserSync.reload); | |
gulp.watch('app/js/**/*.js', browserSync.reload); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment