Replies: 9 comments 24 replies
-
if you are using blade, why you dont use the |
Beta Was this translation helpful? Give feedback.
-
hey, thanks. this is not a blocking issue. i used a static path and put my file in the public folder. the point is to understand why the new Vite system doesn't bundle images, like the documentation is describing. |
Beta Was this translation helpful? Give feedback.
-
Did you succeed? Would suggest you try |
Beta Was this translation helpful? Give feedback.
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
Vite's URL Processing works in the files bundled by Vite ( which .blade.php files are not ). |
Beta Was this translation helpful? Give feedback.
-
it works on dev server with vite_asset helper but yeah still confused if theres automatic image detection and move it into the build/images folder too, but it seems its not working. |
Beta Was this translation helpful? Give feedback.
-
<img src="img/sign_warning.png" alt="" height="16" width="16"/>
<img src="resources/images/sign_warning.png" alt="" height="16" width="16"/>
<img src="public/images/sign_warning.png" alt="" height="16" width="16"/>
<img src="images/sign_warning.png" alt="" height="16" width="16"/>
<img src="@/resources/img/sign_warning.png" alt="" height="16" width="16"/>
<img src="@/resources/images/sign_warning.png" alt="" height="16" width="16"/>
<img :src="/resources/images/sign_warning.png" alt="" height="16" width="16"/>
<img :src="@/resources/images/sign_warning.png" alt="" height="16" width="16"/>
<img :src="./resources/images/sign_warning.png" alt="" height="16" width="16"/>
<img src="./resources/images/sign_warning.png" alt="" height="16" width="16"/>
<img src="{{resource_path('images/sign_warning.png')}}" alt="" height="16" width="16"/>
<img src="{{asset('images/sign_warning.png')}}" alt="" height="16" width="16"/>
<img src="@vite('resources/images/sign_warning.png')" alt="" height="16" width="16"/>
<img src="@vite('images/sign_warning.png')" alt="" height="16" width="16"/>
<img src="@vite('sign_warning.png')" alt="" height="16" width="16"/> I tried all combination as possible, nothing. A PHP framekork which need Javascript just to load images, it amazing. |
Beta Was this translation helpful? Give feedback.
-
LaravelVite documentation states that the For
now you can pass the image file name to
|
Beta Was this translation helpful? Give feedback.
-
Solved You have to follow this meaning, you have to add and also make sure you have facade alias defined: then you can use |
Beta Was this translation helpful? Give feedback.
-
i'm following the docs from here: https://laravel.com/docs/9.x/vite#url-processing
my blade file is in
resources/views/index.blade.php
. my image is inresources/img/pointer.png
. in theindex
file in point to my image as<img src="../img/pointer.png">
. if i got the doc correctly, this should be caught by Vite and bundled. it's not. i end up with the exact same<img src="../img/pointer.png">
in my HTML and of course the image cannot be found.anyone has any idea? thanks.
Beta Was this translation helpful? Give feedback.
All reactions