Now I need helper which check if this json exist and replace regular asseth path or use non-hashed version.
I want used it for css() and js() functions and also for new Asset() and url().
Something like rev('images/logo.svg') which returns images/logo-1fd5c391ed.svg if manifest exist or only images/logo.svg.
Q: Is it possible use file_get_contents with relative path to project root like this: file_get_contents('/assets/dist/rev-manifest.json');? I’m getting error…
I made this little plugin a while ago but haven’t told anyone about it until now. It works quite like the Cachebuster plugin but instead of returning link and script tags, it returns the URL string containing the last modification timestamp.
I needed only the URL to use it on the Meta Tags plugin. Also to have more control over script options like async or defer and to preload assets using HTML preload meta tag.
I’m using Blendid: https://github.com/vigetlabs/blendid for frontend tasks.
So I need working within manifest, which Blendid generate because hashed version also contains hashed adresses for images and fonts.