E
E
Evgeny Zhurov2017-04-09 00:51:34
Pug
Evgeny Zhurov, 2017-04-09 00:51:34

Is it possible to compile .pug to .php with Gulp?

If so, how? Should this be done somehow?)) Otherwise, pug turns out to be somehow of little use ...

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
LesKA, 2017-04-30
@LesKA

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

gulp.task('pug', function() {
  return gulp.src('app/pug/**/*.pug')
   .pipe( pug({pretty: true}) )
   .pipe(rename(function (path) {
      path.extname = ".php"
    }))
  .pipe(gulp.dest('app/'))
  .pipe(browserSync.reload({stream: true}));
  
});

S
Sergey Goryachev, 2017-04-09
@webirus

pug is a regular jade, just a different name, renamed due to a complaint from another brand.
As a result, all the same chips that jade had were available to him.
I currently have a bunch of gulp-pug and gulp-jade-php plugins (while it works).

Z
zooks, 2017-04-09
@zooks

How can Pug files be compiled into php?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question