Hi Vercel Staff,
Sorry for the confusion from the bug report I created before.
At first, I thought this must an issue regarding monorepo or project root directory, given that there were a lot of similar issues in the community.
It turns out I didn’t correctly understand how Vercel functions are deployed: it directly searchs through /api
directory from the sourcecode to found any .js
, .cjs
, .mjs
, .ts
file and deploy each of them as a node runtime function.
In contrast, my previous workflow was to use bundle the entire backend into a single js file, and output it in build directory.
This behavior, IMHO, is really not flexible for developers that prefer a different project structure / workflow.
Since I already found out the solution, this issue is not on high priority. Bu t I genuinely hope the vercel team could address the need, maybe provide a second option in the future.
Thanks you!