【发布时间】:2015-12-01 19:29:56
【问题描述】:
我正在尝试使用 gulp-replace-task 替换 index.php 文件中的文本。我知道这可以在 .html、.css 和 .js 文件中完成,但似乎无法在 .php 文件中使用。
有人可以帮帮我吗?
这是我的代码:
gulp.task('header', function() {
return gulp.src(rootPath + 'templates/header.php')
.pipe(replace({
patterns: [{
json: {
'main.css': 'style.css'
}
}]
}))
// Save the hashed css file
.pipe(gulp.dest(rootPath + 'templates/header.php'));
});
【问题讨论】:
标签: gulp gulp-rev gulp-replace