Skip to content

Commit

Permalink
[fix] allow user to set dev port
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Jun 28, 2022
1 parent 3607f43 commit 84ff8b0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
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

0 comments on commit 84ff8b0

Please sign in to comment.