From 4076d49750be2c262daf393136c39a155260cce0 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 6 Jul 2022 14:13:24 -0400 Subject: [PATCH] use Vite defaults for port and strictPort --- .changeset/dull-ducks-report.md | 5 +++++ packages/kit/src/vite/index.js | 6 ------ packages/kit/test/utils.js | 8 ++++++-- 3 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 .changeset/dull-ducks-report.md diff --git a/.changeset/dull-ducks-report.md b/.changeset/dull-ducks-report.md new file mode 100644 index 000000000000..5d650621dc22 --- /dev/null +++ b/.changeset/dull-ducks-report.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +[breaking] Use Vite defaults for port and strictPort diff --git a/packages/kit/src/vite/index.js b/packages/kit/src/vite/index.js index 94b9857c39f8..197d176cf354 100644 --- a/packages/kit/src/vite/index.js +++ b/packages/kit/src/vite/index.js @@ -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) }, @@ -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 diff --git a/packages/kit/test/utils.js b/packages/kit/test/utils.js index 365a0f8da1a1..ea73e90e9ebd 100644 --- a/packages/kit/test/utils.js +++ b/packages/kit/test/utils.js @@ -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: [