sage-svg icon indicating copy to clipboard operation
sage-svg copied to clipboard

svg not found - cache busting

Open eriteric opened this issue 3 years ago • 2 comments

Just started using sage10, so I'm not sure if this is a new feature or not, but when I run yarn build all images are appended with a cache busting suffix. @asset seems to handle this fine however @svg cannot find them once compiled for production, though it finds them after yarn dev just fine (when they do not have the suffixes).

eriteric avatar Aug 08 '22 04:08 eriteric

For now this worked: @asset('images/svg/image.svg')

eriteric avatar Aug 08 '22 04:08 eriteric

https://github.com/Log1x/sage-svg/blob/master/src/SageSvg.php#L82 should be making this work as intended. 🤔 Could you attempt to debug it a bit?

Log1x avatar Aug 08 '22 07:08 Log1x

Not sure how I resolved this, but it could have been related to the bud proxy

eriteric avatar Dec 03 '22 05:12 eriteric

Hi @Log1x,

I have the same issue. I originally put my icons in the resources/images/icons. When running yarn build, the icons were copied inside the public/images/icons directory with a random suffix which broke the @svg directive.

The solution I found was to move the icons directory out of resources/images so it is not processed by Bud's asset() and update the path in the package config.

<?php

return [

    'path' => resource_path('icons'),

    // ...

Maybe this should be added to the documentation?

marcbelletre avatar Jan 25 '24 11:01 marcbelletre