I'm in the learning stage of vite and replacing the laravel-mix with vite. Now i'm facing a situation that how can I reference images in laravel blades which are passed as entry point in the vite-config?
plugins: [
vue(),
laravel({
input: [
'resources/assets/js/app.js',
'resources/assets/sass/app.scss',
'resources/assets/img/icon-lock.svg'
],
refresh: true,
}),
viteCommonjs,
],
how can I reference the above image which created from vite bundler in the laravel blade?
Also I wondered that by adding images as entry point it creates two files(versioned file + an empty js junk).
but if I import the image into the app.js file instead of adding into the entry point, then there is no empty js chunk file is created...
so what's the difference between adding images as entry point and importing via js?