I’ve setup my vercel.json to run the backend, and 2 frontends in a single project.
the backend and the user frontend are working fine. However, the admin frontend always shows blank page.
Upon checking the dev tools, i noticed that the index.html for adminview (when im on ‘/admin’) is loaded fine, but when it tries to access its css and js assets (the one auto generated by npm build), its getting a 404.
In the sources tab I can see that there isn’t any assets folder while the userview had a assets folder (with js and css) beside its index.html file.
Here’s my vercel.json file:
{
"version": 2,
"builds": [
{
"src": "backend/index.js",
"use": "@vercel/node"
},
{
"src": "userview/package.json",
"use": "@vercel/static-build",
"config": {
"outDir": "./userview/dist"
}
},
{
"src": "adminview/package.json",
"use": "@vercel/static-build",
"config": {
"outDir": "./adminview/dist"
}
}
],
"routes": [
{
"src": "/api(/?.*)",
"dest": "/backend/index.js"
},
{
"src": "/admin(/?.*)",
"dest": "/adminview/$1"
},
{
"src": "/(.*)",
"dest": "/userview/$1"
}
]
}
here, in the screenshot, the userview is working fine and the assets folder is present.
And here, this is the ‘/admin’ page, which is a blank screen and the assets folder is not there.

