Z
Z
ZaxapKramer2017-05-04 14:25:07
Pug
ZaxapKramer, 2017-05-04 14:25:07

Is it possible to change the output file extension in Pug when compiling static templates?

Hello. At the output after compilation (static) from *.pug we get *.html by default. Is it possible to change this somehow - to get *.htm as a result , or even *.php in general ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2017-05-04
@ZaxapKramer

In gallp like this:

gulp.src( '*.pug' )
  .pipe( pug() )
  .pipe( gulp.dest(function(file) {

    file.basename = file.basename.split( '.' )[0] + '.php';

    return 'app/build';

  })
);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question