S
S
saveTibet2017-07-07 10:38:32
Pug
saveTibet, 2017-07-07 10:38:32

Why is gulp-pug compiling a directory instead of a file?

I have been working with galp quite recently, I am taking my first steps. There is a task to take two jade files located in different directories and compile them into two index.html files also located in two different directories.
An example of my task:

gulp.task('jade-en', function buildHTML() {
  return gulp.src('src/jade/en/en-index.jade')
    .pipe(gulp.dest('dist/index.html'));
});
gulp.task('jade-it', function buildHTML() {
  return gulp.src('src/jade/it/it-index.jade')
    .pipe(gulp.dest('dist/it/index.html'));
});

As a result of the task, instead of the expected index.html, I get the "index.html" directories containing the original jade files. What am I doing wrong?
6ab05a75999044a584ca4fcf6dd415e2.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yunus Gaziev, 2017-07-07
@BBoyJuss

you forgot about.pipe(pug())

const pug = require('gulp-pug');

gulp.task('jade-en', function buildHTML() {
  return gulp.src('src/jade/en/en-index.jade')
    .pipe(pug())
    .pipe(gulp.dest('dist/index.html'));
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question