Theo's Typesafe CultTTC
Theo's Typesafe Cult12mo ago
10 replies
greypixel

Images w/ next & vercel

I watched this video a while back where Theo warns against putting images and videos in the /public directory when using vercel. It makes total sense.

What I'm trying to understand, though, is what is happening when I do this:

import greypixel from "../../../assets/images/avatars/greypixel.jpg";

//...

return <img src={greypixel.src} />


Is this essentially the same thing? I understand the bundler is picking up the image and bundling it, and inserting the url to it into my source, but am not sure what this means from the pov of vercel bills etc?

Is it best to avoid this approach?
Was this page helpful?