Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ export default defineConfig({
### preview.port

- **Type:** `number`
- **Default:** `5000`
- **Default:** `4173`

Specify server port. Note if the port is already being used, Vite will automatically try the next available port so this may not be the actual port the server ends up listening on.

Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export async function preview(

const options = config.preview
const hostname = resolveHostname(options.host)
const port = options.port ?? 5000
const port = options.port ?? 4173
const protocol = options.https ? 'https' : 'http'
const logger = config.logger
const base = config.base
Expand Down
2 changes: 1 addition & 1 deletion scripts/jestPerTestSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function startStaticServer(): Promise<string> {
serve(req, res)
}
}))
let port = 5000
let port = 4173
return new Promise((resolve, reject) => {
const onError = (e: any) => {
if (e.code === 'EADDRINUSE') {
Expand Down