Hello everyone,
I'm trying to deploy an Express application to Vercel. My express project is a little different from the templates provided, it generates multiple files when I build the Typescript code.
Here's my vercel.json file:
{ "version": 2, "installCommand": "npm install", "builds": [ { "src": "package.json", "use": "@vercel/node", "config": { "buildCommand": "npm run vercel-build" } } ], "routes": [ { "src": "/(.*)", "dest": "dist/server.js" } ]}When I run npm run vercel-build, one of the steps builds the typescript code into a dist directory.
But when I check the generated 'Output' on the deployment's Source section. I can only see the package.json and middleware files.
I have tried to solve the issues using Vercel's support chat bot, but after a while we started walking in circles with no success.
Below is the 'dist' folder from build output generated locally.

Anyone have a clue on how to solve the issue? Thanks in advance.
UPDATE:
It seems like I don't need to compile ts code, Vercel takes care of it.
So I removed the tsc build command from vercel-build and my vercel.json file now looks like this:
{ "version": 2, "installCommand": "npm install", "buildCommand": "npm run vercel-build", "rewrites": [{ "source": "/(.*)", "destination": "/src" }]}PS: The typescript code is in /src directory.
Results: Still getting 404: NOT_FOUND error.