gulp清除dist文件夹,其中包含assets.json文件

时间:2018-09-20 08:54:12

标签: gulp

运行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)();
};

0 个答案:

没有答案