[Fixed] Sage Roots 8.5.1. Remove Hashes --production

Dear community,

I have been searching for a solution to remove hashes after gulp --production has executed.

So after some testing I created the following task. It might be ugly, but it does the job!
Hopefully this will help someone else out.

gulp.task('remove_hashes', function(){

  var rename = require('gulp-rename');
  const del = require('del');

  gulp.src(path.css + "styles-*.css")
  .pipe(rename("styles.css"))
  .pipe(gulp.dest(path.css)); // ./dist/main/text/ciao/goodbye.md
  del([path.css + 'styles-*.css'], {force: true});

  gulp.src(path.scripts + "jquery-*.js")
  .pipe(rename("jquery.js"))
  .pipe(gulp.dest(path.scripts)); // ./dist/main/text/ciao/goodbye.md
  del([path.scripts + 'jquery-*.js'], {force: true});

  gulp.src(path.scripts + "main-*.js")
  .pipe(rename("main.js"))
  .pipe(gulp.dest(path.scripts)); // ./dist/main/text/ciao/goodbye.md
  del([path.scripts + 'main-*.js'], {force: true});

});

Make sure you create the path.* variables to the destination folders.

Have a great day,

M

You could just set enabled.rev to false.

1 Like