Heim  >  Fragen und Antworten  >  Hauptteil

javascript – So exportieren Sie eine HTML-Datei mit gulp-ejs

Warum exportiere ich immer noch solche .ejs

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

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

});

PHP中文网PHP中文网2669 Tage vor910

Antworte allen(1)Ich werde antworten

  • 怪我咯

    怪我咯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)

    看官网,第二个参数是options,第三个参数才是settings,你上面那么写是把{ext: '.html'}赋值给options了。
    官网地址

    Antwort
    0
  • StornierenAntwort