-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
Description
I have tried in many different ways but the HMR would not work in Laravel.
error in console: net::ERR_ABORTED 404 (Not Found)
I have added following in vite.js
import { defineConfig } from 'vite';
import laravel, { refreshPaths } from 'laravel-vite-plugin';
import VitePluginSvgSpritemap from '@spiriit/vite-plugin-svg-spritemap';
export default defineConfig({
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/js/app.js',
],
refresh: false,
})
VitePluginSvgSpritemap('resources/svg/*.svg', {
injectSVGOnDev: true,
}),
]
});And in my blade layout where i add app.js.
@vite([
'resources/js/app.js',
'@vite-plugin-svg-spritemap/client',
])Svg blade component
@props(['name'])
<svg {{ $attributes->merge(['class' => 'icon']) }}>
<use href="#sprite-{{ $name }}"></use>
{{-- Production --}}
{{-- <use href="{{ Vite::asset('spritemap.svg') }}#sprite-{{ $name }}"></use> --}}
</svg>Screenshots
It seems to generate the HMR script url but does not inject the svg sprites.

Reactions are currently unavailable