Skip to content

Commit 5d165e3

Browse files
author
Kai Volland
committed
set base in vite config
1 parent 84889e1 commit 5d165e3

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/App.svelte

+8-7
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,20 @@
2828
.then((response) => response.text())
2929
.then((text) => parseYaml(text) as Config)
3030
// TODO error handling
31-
// .catch((error) => {
32-
// console.error(error);
33-
// throw new Error("error")
34-
// });
31+
32+
const basePath = location.origin + location.pathname;
3533
</script>
3634

3735
{#if !path}
3836
<div class="error">
39-
Please define config path as search param, e.g. ?config=/public/conf.yaml
37+
<div>
38+
<p>Please define config path as search param, e.g.:</p>
39+
<a href="{basePath}?config=/scrollymap/storyBoard.yml"> {basePath}?config=/scrollymap/storyBoard.yaml</a>
40+
</div>
4041
</div>
4142
{:else}
4243
{#await promise}
43-
<div class="error">Waiting</div>
44+
<div>Waiting</div>
4445
{:then config}
4546
<div class="map">
4647
<Map steps={config.steps} />
@@ -70,7 +71,7 @@
7071
</Scrolly>
7172
</div>
7273
</section>
73-
<!-- TODO error handling
74+
<!-- TODO error handling
7475
{:catch error}
7576
<p>{error.message}</p> -->
7677
{/await}

vite.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { svelte } from '@sveltejs/vite-plugin-svelte';
44
import sveltePreprocess from 'svelte-preprocess';
55

66
export default defineConfig({
7+
base: "/scrollymap/",
78
plugins: [
89
svelte({
910
/* plugin options */

0 commit comments

Comments
 (0)