im trying to lazy load an SVG when my component loads, however when running npm run watch and the component attempts to build it is trying to find this file, of course when the component is compiled down the path it is lazy loading will be different, so i'm getting an error at the moment stating it's unable to locate the file.
My component will compile down to public_html/assets/js/chunks/[hash].js, and my SVG will be within public_html/assets/icons/manufacturer.svg.
How can I stop it trying to compile the path and only load it on load?
// component
computed: {
icon() {
const icons = {
manufacturer: () => import('../../icons/manufacturer.svg')
}
return icons['manufacturer'];
},