Answer the question
In order to leave comments, you need to log in
Gulp crashes on pug autosave. How to decide?
Hello! Tell me , Pug and Gulp experts -
I have autosave in Visual studio code. And when I write pag code - when an error occurs - gulp crashes and I have to constantly restart it. There is no such problem with sass - it shows an error, but the gallp does not crash. This is how my task for pug looks like - how can I add it so that gulp does not crash on error?
gulp.task('pug', function buildHTML() {
return gulp.src('app/pug/pages/*.pug')
.pipe(pug({
// Your options in here.
pretty: '\t'
}))
.pipe(gulp.dest('app'));
});
Answer the question
In order to leave comments, you need to log in
Most likely, you write code, stop at something like this #{, without closing the parenthesis, (or any other expression that causes an error) and switch to another window / ..., while autosaving occurs.
The pug() process starts and it comes to this place and throws you an error.
There is an article on Habré, read it, it might help.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question