Answer the question
In order to leave comments, you need to log in
How to avoid gulp+pug error?
When building a project in gulp, I connect the translation of the pug template engine to html. Excluding the rest of the tasks, the gulpfile.js code is like this.
var gulp = require('gulp');
var watch = require('gulp-watch');
var pug = require('gulp-pug'); // Шаблонизация pug
var htmlbeautify = require('gulp-html-beautify'); // Приведение html в читаемый вид
gulp.task("pug", function() {
var options = {
indentSize: 2
};
return watch("src/*.pug", { ignoreInitial: false })
.pipe(pug())
.pipe(htmlbeautify())
.pipe(gulp.dest("dist/"));
});
// Запуск тасков по умолчанию
gulp.task("default", ["sass", "scripts", "pug", "else", "fonts", "imgs"]);
C:\Users\***\***\***\***>gulp
[21:03:52] Using gulpfile ~\Desktop\***\***\gulpfile.js
[21:03 :52] Starting 'sass'...
[21:03:52] Starting 'scripts'...
[21:03:52] Starting 'pug'...
[21:03:52] Starting 'else'. ..
[21:03:52] Starting 'fonts'...
[21:03:52] Starting 'imgs'...
(node:10408) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection
id: 1): [object Object]
(node:10408) [DEP0018] DeprecationWarning: Unhandled promise rejections are
deprecated. In the future, promise rejections that are not handled will terminate th
e Node.js process with a non-zero exit code.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question