Есть сборка на галпе с преобразованием pug в html, но в конечном файле html становится минифицированным, вот код таска для pug:
const gulp = require('gulp');
const htmlValidator = require('gulp-w3c-html-validator');
const plumber = require('gulp-plumber');
const pug = require('gulp-pug');
const argv = require('yargs').argv;
const gulpif = require('gulp-if');
// Преобразуем Pug в HTML
module.exports = function pug2html() {
return gulp.src('dev/pug/*.pug')
.pipe(plumber())
.pipe(pug())
.pipe(plumber.stop())
.pipe(gulpif(argv.prod, htmlValidator()))
.pipe(gulp.dest('dist'))
};
сам gulpfile
const gulp = require('gulp');
const script = require('./gulp/tasks/scripts');
const fonts = require('./gulp/tasks/fonts');
const vendors = require('./gulp/tasks/vendorsJS');
const imageMinify = require('./gulp/tasks/imageMinify');
const styles = require('./gulp/tasks/styles');
const clean = require('./gulp/tasks/clean');
const pug2html = require('./gulp/tasks/pug');
const spriteSVG = require('./gulp/tasks/spriteSVG');
const serve = require('./gulp/tasks/serve');
const spritePNG = require('./gulp/tasks/spritePNG');
const dev = gulp.parallel(pug2html, script, vendors, styles, imageMinify, spriteSVG, spritePNG, fonts);
exports.default = gulp.series(
clean,
dev,
serve
);