Answer the question
In order to leave comments, you need to log in
How to transfer Gulp to another project?
Help to deal with gallp. It seems that I already installed it, configured it, everything works, and now I want to transfer it to another project, so as not to install everything from scratch, I take the files gulpfile.js, package.json and transfer the directory structure to the folder with the new project. I enter , all packages are pulled up, everything seems to work, except for one. When changing a file in the directory, the page in the browser should be updated using browser-sync, everything works in the old project, not in the new one, although the files are the same with the source code. The terminal displays npm i
[BS] Reloading Browsers..., but the reboot does not occur.
gulp.task('browser-sync', function() {
browserSync({
server: {
baseDir: 'app'
},
notify: false
});
});
gulp.task('watch', ['browser-sync', 'css-libs', 'scripts'], function() {
gulp.watch('app/sass/**/*.scss', ['sass']);
gulp.watch('app/*.html', browserSync.reload);
gulp.watch('app/js/**/*.js', browserSync.reload);
});
Answer the question
In order to leave comments, you need to log in
On Win10, the same problem was, after a dozen restarts of gulp tasks, it somehow understood what to do. On *unix this was not yet the case. Try
browserSync.init({
server: {
baseDir: './app'
}
Is there a body tag in the HTML file? Faced with similar, it turns out stupidly he lacked this tag
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question