这是一个简化的例子,但我无法让它发挥作用。我正在尝试将这些步骤构建到我的工作流程中......
继承了持续崩溃的相关代码
控制台输出截图:http://cl.ly/X8Es
var gulp = require('gulp'),
rev = require('gulp-rev');
revReplace = require('gulp-rev-replace');
replace = require('gulp-replace');
filter = require('gulp-filter');
useref = require('gulp-useref');
gulp.task("revtest", function() {
var cssFilter = filter('css/*.min.css');
return gulp.src("snippets/_head.html")
.pipe(cssFilter)
.pipe(cssFilter.restore())
.pipe(rev())
.pipe(useref.restore())
.pipe(useref())
.pipe(revReplace())
.pipe(gulp.dest('./'));
});
答案 0 :(得分:0)
我有类似的问题。看看这些来源应该有用:
var gulp = require('gulp'),
rev = require('gulp-rev');
revReplace = require('gulp-rev-replace');
replace = require('gulp-replace');
filter = require('gulp-filter');
useref = require('gulp-useref');
gulp.task("revtest", function() {
var cssFilter = filter('css/*.min.css');
var assets = useref.assets();
return gulp.src("snippets/_head.html")
.pipe(cssFilter)
.pipe(cssFilter.restore())
.pipe(rev())
.pipe(assets.restore())
.pipe(useref())
.pipe(revReplace())
.pipe(gulp.dest('./'));
});