How to Change vite application port

Viewed 956
  • If you are change the vite application port please follow the procedure.

"scripts": { "dev": "vite --port 3006", "build": "vite build", "preview": "vite preview" }

2 Answers

Try add your port into vite.config.ts:

 export default defineConfig({
  // ...some configs
  server: {
    port: 3006,
  },
});

Replace this: vite --port 3006 with this: vite --port=3006

Related