Asset file paths in gulp-rev’s asset manifest

I’m curious if there a simple way to include the full asset file path of the revved assets that appear in the generated assets.json manifest file. The initial directory seems to be dropped from the listed file paths (i.e. /styles/, /scripts/, etc).

I realize Roots\Sage\Assets\asset_path extracts the $directory from the passed in filename, but I guess I’m concerned about multiple identically named files causing the manifest to overwrite identically keyed mappings. (I’ve expanded the gulpfile.js functionality to include more files than default, I’m revving image files also.)

For example, if I had these two files within assets, and they were both revved,

the resulting assets.json would be

  "main.css": "main-1de54bf1.css",
  "editor-style.css": "editor-style-d4bb7410.css",
  "modernizr.js": "modernizr-b4a03e7f.js",
  "jquery.js": "jquery-e5581654.js",
  "main.js": "main-58c4fa7b.js"
  "": ""

— only one reference to, despite it being two distinct files in two distinct directories.

I realize this may be an edge case, just wasn’t sure if it was simple to get another directory level prepended in the file’s file path to avoid these potential collisions.


1 Like