I have been looking arround on how to set a production port for vite but I can't find way I have tried this vite js config
server: {
host: true,
},
preview:{
port:5005
}
but it seems like it can't work
I have been looking arround on how to set a production port for vite but I can't find way I have tried this vite js config
server: {
host: true,
},
preview:{
port:5005
}
but it seems like it can't work
According to documentation this should work
export default defineConfig({
server: {
port: 3030
},
preview: {
port: 8080
}
})
But if it doesn't work add --port
on preview command in package.json
"scripts": {
"serve": "vite preview --port 6000"
},
In package.json, add this code
"scripts": {
"serve": "vite --port 8000"
},
In terminal, run the command
npm run serve
just update you npm run dev command to:
"dev": "vite --port=8080"
in the package.json file
© 2022 - 2024 — McMap. All rights reserved.
server.host
instead ofserver.port
. I know this is old, but noone mentioned this before.. Maybe it helps somebody with the same trouble :) – Chapiter