Skip to content

Instantly share code, notes, and snippets.

@CodeXT1
CodeXT1 / Gulpfile.js
Last active May 24, 2016 08:44
RequireJS, r.js multi-bundle edge case with Gulp-Rev-All. RequireJS doesn't like to have .js extentions on bundles, even though they often map directly to .js files, so Gulp-Rev-All misses them. This is a very hack script I made to run after Gulp-Rev-All has hashed everything else. It loads *.js files in the final build directory and parses out …
var gulp = require('gulp'),
glob = require('glob'),
$ = require('gulp-load-plugins');
//Needs gulp-replace too, you'll see
//and gulp-rev-all is assumed to have already been run on the whole build dir.
// This is the gulp task to replace the few missed link references in the RequireJS
// common bundle after using the Gulp-Rev-All to hash and update everything else
gulp.task('bundle-replace', function() {