How to use the gulp-rev-all.revision function in gulp-rev-all

To help you get started, we’ve selected a few gulp-rev-all 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 kubernetes / dashboard / build / build.js View on Github external
function doRevision() {
  return gulp
      .src([path.join(conf.paths.distPre, '**'), '!**/assets/**/*'])
      // Do not update references other than in index.html. Do not rev index.html itself.
      .pipe(revAll.revision(
          {dontRenameFile: ['index.html'], dontSearchFile: [/^(?!.*index\.html$).*$/]}))
      .pipe(gulp.dest(conf.paths.distRoot));
}
github Tencent / tmt-workflow / _tasks / TaskBuildDist.js View on Github external
dontUpdateReference: ['.html'],
      includeFilesInManifest: ['.css', '.js', '.html', 'htm'],
      transformFilename: function (file, hash) {
        var ext = path.extname(file.path);

        // if(ext === '.html'){
        //     return path.basename(file.path, ext) + ext;
        // }

        return path.basename(file.path, ext) + '.' + hash.substr(0, 8) + ext;
      }
    };

    if (config['reversion']) {
      return gulp.src(['./tmp/**/*'])
        .pipe(RevAll.revision(RevOptions))
        .pipe(gulp.dest(paths.tmp.dir))
        .pipe(revDel({
          exclude: /(.html|.htm)$/
        }))
        .pipe(RevAll.manifestFile())
        .pipe(gulp.dest(paths.tmp.dir));
    } else {
      cb();
    }
  }
github pypa / warehouse / Gulpfile.babel.js View on Github external
path.join(distPath, "webfonts", "*"),

    // Cachebust our JS files and the source maps for them.
    path.join(distPath, "js", "*.js"),
    path.join(distPath, "js", "*.map"),

    // Cachebust our vendored JS files and the source maps for them.
    path.join(distPath, "js", "vendor", "*.js"),
    path.join(distPath, "js", "vendor", "*.map"),

    // Cachebust our Image files.
    path.join(distPath, "images", "*"),
  ];

  return gulp.src(paths, { base: distPath })
    .pipe(manifest.revision({
      fileNameManifest: "manifest.json",
      includeFilesInManifest: [
        ".css",
        ".map",
        ".woff",
        ".woff2",
        ".svg",
        ".eot",
        ".ttf",
        ".otf",
        ".png",
        ".jpg",
        ".ico",
        ".js",
      ],
    }))
github mozilla / testpilot / frontend / tasks / dist.js View on Github external
gulp.task('dist-rev-assets', function() {
  const revAll = RevAll.revision({
    dontRenameFile: [
      '.json',
      'favicon.ico',
      /static\/addon\/*/,
      /static\/locales\/*/,
      /static\/images\/experiments\/[^]*\/social\/*/,
      '.html',
      '.rss',
      '.atom'
    ],
    dontUpdateReference: [
      /static\/addon\/*/,
      /static\/locales\/*/,
      /.*\.json/,
      /static\/images\/experiments\/[^]*\/social\/*/,
      'favicon.ico',
github weijhfly / js-utils / gulp-util / gulpfile.js View on Github external
gulp.task("hash", done => {
    gulp
        .src("dist/**")
        .pipe(
            gulpIf('*.js',uglify())
        )
        .pipe(  
            gulpIf(isImage, imagemin()) 
        )
        .pipe(
            RevAll.revision({
                dontRenameFile: [/\.html$/]
            })
        )
        .pipe(revdel({
            exclude: function (file) {
                if (/\.html$/.test(file.name)) {
                    return true; //if you want to exclude the file from being deleted
                }
            }
        }))
        .pipe(gulp.dest("dist"))

    done();
});
github jkazama / sample-ui-react / gulpfile.babel.js View on Github external
gulp.task('revision:append', () => {
  return gulp.src(`${paths.dist.root}/**/*`)
    .pipe(RevAll.revision({dontRenameFile: [/^\/favicon.ico$/g, '.html']}))
    .pipe(gulp.dest(root.tmp))
})
github cypress-io / cypress / packages / example / gulpfile.js View on Github external
gulp.task('assets', function () {
  let revAllOpts = {
    dontGlobal: ['.ico', 'fira.css', 'javascript-logo.png'],
    dontRenameFile: ['.ico', '.html', /fonts/],
    dontSearchFile: ['.js'],
    debug: false,
  }

  return gulp.src('./app/**/*')
  .pipe(RevAll.revision(revAllOpts))
  .pipe(gulp.dest('build'))
})
github luangjokaj / gopablo / gulpfile.js View on Github external
function bustCaches() {
	return src(['./dist/**'])
		.pipe(
			RevAll.revision({
				dontRenameFile: [/^\/favicon.ico$/g, '.html'],
				dontUpdateReference: [/^\/favicon.ico$/g, '.html'],
			}),
		)
		.pipe(dest('./dist'))
		.on('end', () => {
			gutil.beep();
			gutil.log(filesGenerated);
			gutil.log(thankYou);
		});
}
github cypress-io / cypress-documentation / gulpfile.js View on Github external
gulp.task('revision', () => {
  return gulp
  .src('public/**')
  .pipe(RevAll.revision(revisionOpts))
  .pipe(gulp.dest('tmp'))
})

gulp-rev-all

Static asset revisioning by appending content hash to filenames: unicorn.css => unicorn.098f6bcd.css, also re-writes references in each file to new reved name.

MIT
Latest version published 2 years ago

Package Health Score

57 / 100
Full package analysis

Popular gulp-rev-all functions