Running `vite build` doesn't create a .output folder anymore in RC
I've been able to migrate my project to RC and everything's running fine but when I tried building it, a .output folder wasn't created, but in the docs the output folder is still used. Any tips about how I can build and start my app?
Here's my vite config
7 Replies
unwilling-turquoise•2w ago
If you don’t need Nitro, you can use srvx to serve your project.
You can use the Nitro v2 plugin the same way as before the RC version , create an .output folder.
"start": "pnpx srvx --prod -s ../client dist/server/server.js"
absent-sapphireOP•2w ago
This worked! Thank you so much!
conscious-sapphire•2w ago
Nice, I didn't know about srvx. The docs have not been updated to the release.
genetic-orange•7d ago
This is helping me with the same problem, but I can't get the client directory right. I've got
pnpx srvx --prod -s dist/client dist/server/server.js
, and I get the below output:
The server is accessible, but none of the static files are available. I've tried manually moving the contents of dist/client
to dist/client/public
and that still doesn't work. If I'm reading the srvx docs right, the -s dist/client
should be configuring it to consider that the as public directory? But the message on Static files makes it seems like it's not finding anything configured.
Never mind--should have taken the command verbatim. The client path is relative to the server file.yappiest-sapphire•7d ago
are you able to get the static assets to work it returns a 404 for me path is correct

genetic-orange•7d ago
Is the trailing
/
in the static files affecting anything?yappiest-sapphire•7d ago
dont think so the command i use is:
"preview": "dotenv -- srvx --prod -s ../client dist/server/server.js",
it just seems to not run the middleware as i see my not found component being rendered