Answer the question
In order to leave comments, you need to log in
Why is gulp-pug not being updated?
Hello!
After a long wandering through all sorts of Vue / Angular cli, I had to return to Gulp. The problem is that when changing nested .pug files in the pug folder, the reload does not work (pug compiles to html, the problem is in the reload)
var syntax = "scss";
gulp.task("browser-sync", function() {
browserSync({
server: {
baseDir: "app"
},
notify: false,
open: false
});
});
gulp.task("pug", function() {
gulp
.src("app/pug/*.pug")
.pipe(
pug({
doctype: "html",
pretty: true
})
)
.pipe(gulp.dest("app/"))
.pipe(browserSync.stream());
});
gulp.task("watch", function() {
gulp.watch("app/pug/*.pug", gulp.parallel("pug"));
});
gulp.task(
"default",
gulp.parallel("pug", "styles", "browser-sync", "watch")
);
Answer the question
In order to leave comments, you need to log in
I suggest doing this:
var browserSync = require('browser-sync').create()
var bsConfig = {
server: {
baseDir: 'app'
},
notify: false,
open: false
};
gulp.task('watch', function(){
browserSync.init(bsConfig);
gulp.watch("app/pug/*.pug", gulp.parallel("pug"));
})
Watcher
I suggest using it this way
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question