I've recently switched a Vue CLI project to Vite. It's impressive how fast things are - but makes complete sense when there's no build step needed when developing.
One thing I've found less intuitive are images, especially dynamically referenced ones (e.g. in a loop). I've had to create a utility for this:
export function getImageUrl (name) {
return new URL(`../assets/${name}`, import.meta.url).href;
}
I've recently switched a Vue CLI project to Vite. It's impressive how fast things are - but makes complete sense when there's no build step needed when developing.
One thing I've found less intuitive are images, especially dynamically referenced ones (e.g. in a loop). I've had to create a utility for this:
Is this also the case in React?
Yes , Similar in react