嗨,我使用gulp将我的.ejs文件自动编译为html文件,但是当gulp-ejs编译文件时,它就像ejs一样输出。我需要在ejs()对象中定义.html扩展名,但是我可以使它工作。
这是我到目前为止所得到的:
gulp.task('ejs', function(){
return gulp.src('src/templates/**/*.ejs')
.pipe(ejs())
.pipe(gulp.dest('builds/dev/'))
});
Run Code Online (Sandbox Code Playgroud)
我也尝试过这个:
gulp.task('ejs', function(){
return gulp.src('src/templates/**/*.ejs')
.pipe(ejs({setting: '.html'}))
.pipe(gulp.dest('builds/dev/'))
});
Run Code Online (Sandbox Code Playgroud)
溴
我正在使用Gulp并且已经使用了Gulp Autoprefixer独立版本,例如:
gulp.task('styles', function() {
gulp.src('scss/**/*.scss')
//.................
.pipe(sass())
.pipe(autoprefixer({
browsers: [
//..........
],
}))
//............
});
Run Code Online (Sandbox Code Playgroud)
...但是随后我看到了Gulp Postcss插件,该插件似乎包装了非Gulp自动前缀的用法,例如:
gulp.task('styles', function() {
gulp.src('scss/**/*.scss')
//.................
.pipe(sass())
.pipe(postcss([
autoprefixer({
browsers: [
//.......
],
}),
]))
//............
});
Run Code Online (Sandbox Code Playgroud)
有什么不同?