javascript - How to export .html file with gulp-ejs
PHP中文网
PHP中文网 2017-06-28 09:26:27
0
1
899

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中文网

认证高级PHP讲师

reply all(1)
刘奇
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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!