Skip to content

Commit

Permalink
use Vite defaults for port and strictPort (#5392)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Jul 8, 2022
1 parent e60a014 commit 4d4dd15
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-ducks-report.md
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

[breaking] Use Vite defaults for port and strictPort
6 changes: 0 additions & 6 deletions packages/kit/src/vite/index.js
Expand Up @@ -156,10 +156,6 @@ function kit() {
input: `${get_runtime_path(svelte_config.kit)}/client/start.js`
}
},
preview: {
port: config.preview?.port ?? 3000,
strictPort: config.preview?.strictPort ?? true
},
resolve: {
alias: get_aliases(svelte_config.kit)
},
Expand All @@ -177,8 +173,6 @@ function kit() {
])
]
},
port: config.server?.port ?? 3000,
strictPort: config.server?.strictPort ?? true,
watch: {
ignored: [
// Ignore all siblings of config.kit.outDir/generated
Expand Down
8 changes: 6 additions & 2 deletions packages/kit/test/utils.js
Expand Up @@ -136,14 +136,18 @@ export const test = base.extend({
}
});

const port = 3000;

/** @type {import('@playwright/test').PlaywrightTestConfig} */
export const config = {
forbidOnly: !!process.env.CI,
// generous timeouts on CI
timeout: process.env.CI ? 45000 : 15000,
webServer: {
command: process.env.DEV ? 'npm run dev' : 'npm run build && npm run preview',
port: 3000
command: process.env.DEV
? `npm run dev -- --port ${port}`
: `npm run build && npm run preview -- --port ${port}`,
port
},
retries: process.env.CI ? 5 : 0,
projects: [
Expand Down

0 comments on commit 4d4dd15

Please sign in to comment.