Vercel deploys functions directly from sourcecode, BEFORE build step, which could be inflexible to devs

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!

1 Like

Thanks for coming back with your thoughts, @hmpthz! :pray: Glad it’s working now for you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.