I need to config server port for Nuxt3. I try to do it so:
nuxt.config.ts
import { defineNuxtConfig } from 'nuxt3'
export default defineNuxtConfig(
vite: {
server: {
port: 5000,
},
},
})
But it doesn't work. How to set server port in Nuxt3?
As told here, this is currently not supported.
Change it like this
{
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev --port=5678", // here
"generate": "nuxt generate",
"preview": "nuxt preview"
},
"devDependencies": {
"nuxt": "3.0.0-rc.1"
}
}
Here is how to change the port for production: https://github.com/nuxt/framework/discussions/1884#discussioncomment-1631668