[Bug?]: Vite server config is being ignored
Duplicates
- [X] I have searched the existing issues
Latest version
- [X] I have tested the latest version
Current behavior 😯
example app.config.ts:
export default defineConfig({
vite: {
server: {
host: "127.0.0.1",
port: 8080,
},
plugins: [],
},
});
but this isnt working, its still running on port:3000
Expected behavior 🤔
Run server on specified PORT and HOST
Steps to reproduce 🕹
Steps:
1.Edit vite server options on app.config.ts
2.Run server
3.
4.
Context 🔦
A fix:
https://nitro.unjs.io/deploy/runtimes/node#environment-variables
in .env
PORT=3000
HOST=127.0.0.1
I think this is because Im not using vite-solid-plugin? Hope this helps someone at least.
Your environment 🌎
No response
Solid start already configures vite-plugin-solid for you, so that's not the issue. The disconnect must be somewhere else.
I suspect this is due to Vinxi. I added back the dev server options because some of them work. Others may not. Will need to double check with @nksaraf to get clarity on this.
Yeah I feel like the host and port shouldnt be server config since you probably only mean the dev server. So I think the dev command is the place those things should be overriden. You can use '--host' and '--port' options (can make it part of your npm dev script) or HOST and PORT environment variables
It would be convenient to have the options on the start command as well