Answer the question
In order to leave comments, you need to log in
How to specify multiple directories in browsersync?
I decided to try to master browsersync. But I can't make it so that two files are updated in different directories, for example /index.html and css/main.css. How to register in watch that would simultaneously track changes in the file at the root and in the file in the folder.
Worth gulp
const gulp = require('gulp');
const browserSync = require('browser-sync').create();
const reload = browserSync.reload;
gulp.task('server', function() {
browserSync.init({
server: {
port: 9000,
baseDir: "source"
}
});
gulp.watch("source/!**!/!*"). on('change', reload);
});
Thank you in advance for your response.
Answer the question
In order to leave comments, you need to log in
browserSync.watch('./source/**/*.*').on('change', browserSync.reload);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question