How to use gulp-rev-rewrite - 2 common examples

To help you get started, we’ve selected a few gulp-rev-rewrite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github larsonjj / generator-yeogurt / generators / app / templates / gulp / tasks / rev.js View on Github external
gulp.task('rev', () => {
  // gulp-rev-rewrite will mangle binary files (images, etc), so ignore them
  const binaryAssetFilter = gulpFilter(
    ['**', '!**/*.{ico,png,jpg,jpeg,gif,webp}'],
    { restore: true }
  );
  const htmlFilter = gulpFilter(['**', '!**/*.html'], { restore: true });
  return gulp
    .src(`**/*.{js,css,html}`, { cwd: dirs.destination })
    .pipe(htmlFilter)
    .pipe(gulpRev())
    .pipe(htmlFilter.restore)
    .pipe(binaryAssetFilter)
    .pipe(gulpRevRewrite())
    .pipe(binaryAssetFilter.restore)
    .pipe(gulp.dest(dest))
    .pipe(gulpRevDel())
    .pipe(gulpRev.manifest())
    .pipe(gulp.dest(dest));
});
github Dan503 / time-input-polyfill / gulp / tasks / rev.js View on Github external
gulp.task('rev', () => {
	// gulp-rev-rewrite will mangle binary files (images, etc), so ignore them
	const binaryAssetFilter = gulpFilter(
		['**', '!**/*.{ico,png,jpg,jpeg,gif,webp}'],
		{ restore: true }
	)
	const htmlFilter = gulpFilter(['**', '!**/*.html'], { restore: true })
	return gulp
		.src(`**/*.{js,css,html}`, { cwd: dirs.destination })
		.pipe(htmlFilter)
		.pipe(gulpRev())
		.pipe(htmlFilter.restore)
		.pipe(binaryAssetFilter)
		.pipe(gulpRevRewrite())
		.pipe(binaryAssetFilter.restore)
		.pipe(gulp.dest(dest))
		.pipe(gulpRevDel())
		.pipe(gulpRev.manifest())
		.pipe(gulp.dest(dest))
})

gulp-rev-rewrite

Rewrite references to assets that have been revisioned using gulp-rev

MIT
Latest version published 8 months ago

Package Health Score

67 / 100
Full package analysis

Popular gulp-rev-rewrite functions