Skip to content
Open
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/gold-wolves-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: reusing `kit.base.path` default in different phases
6 changes: 4 additions & 2 deletions packages/kit/src/exports/vite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,8 @@ async function kit({ svelte_config }) {
/** @type {import('vite').UserConfig} */
let new_config;

const kit_paths_base = kit.paths.base || '/';

if (is_build) {
const ssr = /** @type {boolean} */ (config.build?.ssr);
const prefix = `${kit.appDir}/immutable`;
Expand Down Expand Up @@ -872,7 +874,7 @@ async function kit({ svelte_config }) {
// That's larger and takes longer to run and also causes an HTML diff between SSR and client
// causing us to do a more expensive hydration check.
const client_base =
kit.paths.relative !== false || kit.paths.assets ? './' : kit.paths.base || '/';
kit.paths.relative !== false || kit.paths.assets ? './' : kit_paths_base;

const inline = !ssr && svelte_config.kit.output.bundleStrategy === 'inline';
const split = ssr || svelte_config.kit.output.bundleStrategy === 'split';
Expand Down Expand Up @@ -931,7 +933,7 @@ async function kit({ svelte_config }) {
} else {
new_config = {
appType: 'custom',
base: kit.paths.base,
base: kit_paths_base,
build: {
rollupOptions: {
// Vite dependency crawler needs an explicit JS entry point
Expand Down
Loading