Open magne4000 opened 9 months ago
I currently am trying to build my application with some png files in a "hidden" folder in /api
, at /api/_images/*.png
for example, but this yields a build error saying no loader for png files is provided.
Is this a similar issue? Why is Vite trying to bundle these png files?
Could you create a small reproduction repo so that I can see what you are trying to do?
@magne4000 Here you are: https://github.com/reusables-official/vite-vercel-debug, notes in README
I would recommend moving the .png
files outside of /api
folder. Vite defaults to public folder for this kind of usage.
I would recommend moving the
.png
files outside of/api
folder. Vite defaults to public folder for kind of usage.
OK thank you I can try that. I believe my confusion is coming from a misunderstanding of Vite as a client app bundler and how it relates to Vercel's API folder/serverless functions. I wasn't aware that I could include files from the "client code" side of things in the Vercel function but given it's all just a file system I suppose it makes sense. Perhaps I'm still in the client/server paradigm which is blurred in this context.
With sensitive default value (like ignoring .test and .spec files)