Home  >  Q&A  >  body text

javascript - How to export .html file with gulp-ejs

Why do I still export .ejs like this

gulp.task('ejs', function() {

gulp.src('html/index.ejs')
    .pipe(ejs({},{ext: '.html'}))
.pipe(gulp.dest('./dist'));

});

PHP中文网PHP中文网2669 days ago908

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-06-28 09:28:27

    gulp.task('ejs', function() {
        gulp.src('html/index.ejs')
            .pipe(ejs({},{},{ext: '.html'}))
            .pipe(gulp.dest('./dist'));
    });

    ejs(data, options, settings)

    Look at the official website, the second parameter is options, and the third parameter is settings. What you wrote above is assigning {ext: '.html'} to options.
    Official website address

    reply
    0
  • Cancelreply