Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] allow user to set dev port #5303

Merged
merged 1 commit into from
Jun 29, 2022
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
5 changes: 5 additions & 0 deletions .changeset/four-glasses-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

[fix] allow user to set dev port
14 changes: 6 additions & 8 deletions packages/kit/src/vite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,11 @@ function kit() {
},
preview: {
port: config.preview?.port ?? 3000,
strictPort: true
strictPort: config.preview?.strictPort ?? true
},
resolve: {
alias: get_aliases(svelte_config.kit)
},
root: cwd,
server: {
fs: {
allow: [
Expand All @@ -168,16 +167,15 @@ function kit() {
])
]
},
port: 3000,
strictPort: true,
port: config.server?.port ?? 3000,
strictPort: config.server?.strictPort ?? true,
watch: {
ignored: [
// Ignore all siblings of config.kit.outDir/generated
`${posixify(svelte_config.kit.outDir)}/!(generated)`
]
}
},
spa: false
}
};
},

Expand Down Expand Up @@ -334,8 +332,8 @@ function kit() {
/**
* @param {Record<string, any>} config
* @param {Record<string, any>} enforced_config
* @param {string} path
* @param {string[]} out
* @param {string} [path]
* @param {string[]} [out] used locally to compute the return value
*/
function find_overridden_config(config, enforced_config, path = '', out = []) {
for (const key in enforced_config) {
Expand Down