T
T
Test2017-06-21 18:14:10
HTML
Test, 2017-06-21 18:14:10

How to properly build jade(pug) with gulp?

There is a gulp collector

//Компиляция 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'));
  });

It collects the file
html
  head
  body
  footer

But collects it in unformatted html
<html><head></head><body></body><footer></footer></html>

I used gulp-jade and gulp-pug to build (the result is the same). gulp-pug also accepts some parameters (maybe a solution to the problem). So, is it possible to assemble jade correctly somehow, or is it necessary to fence a third-party solution for formatting this string?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Shvedov, 2017-06-21
@fedor_dev

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 (eg '\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.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question