Skip to content
Discussion options

You must be logged in to vote

You can change the default port in Vite by updating the vite.config.js file.

Example:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
plugins: [react()],
server: {
port: 3000
}
})

After saving the file, restart the Vite server. Your app will run on port 3000.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by itsamritamalik-ctrl
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants