How to configure the port of the production server?
Here is the vite config
Then
I want it to listen on port 8080.
Build info
export default defineConfig({
server: {
port: 8080,
},
plugins: [
tsConfigPaths({
projects: ["./tsconfig.json"],
}),
tanstackStart({ customViteReactPlugin: true, target: "node-server" }),
viteReact(),
],
});export default defineConfig({
server: {
port: 8080,
},
plugins: [
tsConfigPaths({
projects: ["./tsconfig.json"],
}),
tanstackStart({ customViteReactPlugin: true, target: "node-server" }),
viteReact(),
],
});Then
pnpm buildpnpm buildpnpm start
> node .output/server/index.mjs
Listening on http://[::]:3000pnpm start
> node .output/server/index.mjs
Listening on http://[::]:3000I want it to listen on port 8080.
Build info
✓ built in 1.04s
vite v6.3.5 building SSR bundle for production...
✓ 118 modules transformed.
[plugin vite:css-post] Sourcemap is likely to be incorrect: a plugin (vite:css-post) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
✓ built in 346ms
✔ Generated public .output/public nitro 11:43:59 am
ℹ Building Nitro Server (preset: node-server, compatibility date: 2024-11-19) nitro 11:43:59 am
✔ Nitro Server built ✓ built in 1.04s
vite v6.3.5 building SSR bundle for production...
✓ 118 modules transformed.
[plugin vite:css-post] Sourcemap is likely to be incorrect: a plugin (vite:css-post) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
✓ built in 346ms
✔ Generated public .output/public nitro 11:43:59 am
ℹ Building Nitro Server (preset: node-server, compatibility date: 2024-11-19) nitro 11:43:59 am
✔ Nitro Server built