-
-
Save SilencerWeb/fa515ceb48fe37f6b1fea5a9765aa203 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')) /* только папки, не указывать отдельные файлы*/ | |
}); | |
gulp.task('browser-sync', function () { | |
browserSync({ | |
server: { | |
baseDir: './app', | |
serveStaticOptions: { | |
extensions: ['html'] | |
} | |
}, | |
ui: false, | |
host: 'localhost', | |
port: 3000, | |
open: false, | |
notify: false, | |
ReloadOnRestart: true, | |
ghostMode: { | |
clicks: false, | |
forms: false, | |
scroll: false, | |
}, | |
}); | |
}); | |
gulp.task('reload', function (callback) { | |
browserSync.reload(); | |
callback(); | |
}); | |
gulp.task('watch', gulp.series('browser-sync', 'sass'), function() { | |
gulp.watch('app/sass/**/*.sass', gulp.series('sass:dev', 'reload')); | |
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