Skip to content

Commit 376b986

Browse files
committed
update: patched sveltekit to allow relative pathing
remove path once sveltejs/kit#13812 is merged
1 parent 4af6941 commit 376b986

File tree

3 files changed

+40
-6
lines changed

3 files changed

+40
-6
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@
6565
"esbuild",
6666
"electron",
6767
"electron-winstaller"
68-
]
68+
],
69+
"patchedDependencies": {
70+
"@sveltejs/kit": "patches/@sveltejs__kit.patch"
71+
}
6972
}
7073
}

patches/@sveltejs__kit.patch

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/src/exports/vite/index.js b/src/exports/vite/index.js
2+
index e23cf2b833fc0a04287d34328b97bf64c7916f0d..81b6f30f3a5f2c8d3d0337777e141e549c4a5f98 100644
3+
--- a/src/exports/vite/index.js
4+
+++ b/src/exports/vite/index.js
5+
@@ -473,7 +473,7 @@ Tips:
6+
// for internal use only. it's published as $app/paths externally
7+
// we use this alias so that we won't collide with user aliases
8+
case sveltekit_paths: {
9+
- const { assets, base } = svelte_config.kit.paths;
10+
+ const { assets, base, relative } = svelte_config.kit.paths;
11+
12+
// use the values defined in `global`, but fall back to hard-coded values
13+
// for the sake of things like Vitest which may import this module
14+
@@ -488,10 +488,10 @@ Tips:
15+
16+
return dedent`
17+
export let base = ${s(base)};
18+
- export let assets = ${assets ? s(assets) : 'base'};
19+
+ export let assets = ${relative ? "'.' + " : ''}${assets ? s(assets) : 'base'};
20+
export const app_dir = ${s(kit.appDir)};
21+
22+
- export const relative = ${svelte_config.kit.paths.relative};
23+
+ export const relative = ${relative};
24+
25+
const initial = { base, assets };
26+

pnpm-lock.yaml

Lines changed: 10 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)