运行gulp时,它将重新创建dist文件夹。然后,它确实包含原始文件夹中存在的assets.json。下面是gulpfile。
// Path to the compiled assets manifest in the dist directory
var revManifest = path.dist + 'assets.json';
// ### Write to rev manifest
// If there are any revved files then write them to the rev manifest.
// See https://github.com/sindresorhus/gulp-rev
var writeToManifest = function(directory) {
return lazypipe()
.pipe(gulp.dest, path.dist + directory)
.pipe(browserSync.stream, {match: '**/*.{js,css}'})
.pipe(rev.manifest, revManifest, {
base: path.dist,
merge: true
})
.pipe(gulp.dest, path.dist)();
};