@fedor_dev

Как правильно собрать jade(pug) при помощи gulp?

Есть gulp сборщик
//Компиляция jade
	gulp.watch('source/jade/*.jade',function(jade_f) {
		gulp.src(jade_f.path)
		.pipe(pug({

		}))
		.pipe(rename(function (path) {
			path.basename = "index";
			path.extname = ".html"
		}))
		.pipe(gulp.dest('dist'));
	});

Он собирает файл
html
  head
  body
  footer

Но собирает его в не форматированный html
<html><head></head><body></body><footer></footer></html>

Для сборки я использовал gulp-jade и gulp-pug(результат один и тот-же). gulp-pug ещё принимает какие-то параметры(возможно решение проблемы). Так вот можно как то правильно собрать jade или надо городить стороннее решение для форматирования этой строки?
  • Вопрос задан
  • 727 просмотров
Решения вопроса 1
mmmaaak
@mmmaaak
pretty: boolean | string
[Deprecated.] Adds whitespace to the resulting HTML to make it easier for a human to read using ' ' as indentation. If a string is specified, that will be used as indentation instead (e.g. '\t'). We strongly recommend against using this option. Too often, it creates subtle bugs in your templates because of the way it alters the interpretation and rendering of whitespace, and so this feature is going to be removed. Defaults to false.
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы