How to get the same app.js or app.css versioning number

Hey there!

I’m using a sprites.svg file to load my svgs but my company has cached trough CloudFlare all the assets, so the only way to get a new clean version is to version that file but I don’t want to use a custom versioning function I think it could be better to get the same versioning ID than the app css and js are getting every time I build because I’m also re-generating that file every time I rebuild all my assets to deploy them to production.

To show that file on the blade templates I’m doing something like this:

<svg class="block  w-9 h-9 pt-2 md:hidden" role="img">     
    <use xlink:href="@asset('images/svg/sprites.svg')#icon-locker-w" /> 
</svg>

Would you have any idea how to achieve that?

Hi @lajennylove,

In production, your assets should already be receiving a hash suffix, if you’re using bud.assets() pr bud.copyFile(). In dev, no hash will be generated.

You can change the hash format (or remove it entirely) by using bud.hash()

The available variables come directly from Webpack. They’re here.

Hope that helps!

1 Like