Skip to content

Commit 7660e24

Browse files
committed
Workaround vite problem on GH pages
1 parent 24b992d commit 7660e24

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

web/src/App.svelte

+16-4
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,22 @@
8686
console.log(e.detail.error);
8787
}}
8888
images={[
89-
{ id: "walk_cycle_only", url: "/filters/walk_cycle_only_icon.gif" },
90-
{ id: "no_entry", url: "/filters/no_entry_icon.gif" },
91-
{ id: "bus_gate", url: "/filters/bus_gate_icon.gif" },
92-
{ id: "school_street", url: "/filters/school_street_icon.gif" },
89+
{
90+
id: "walk_cycle_only",
91+
url: `${import.meta.env.BASE_URL}/filters/walk_cycle_only_icon.gif`,
92+
},
93+
{
94+
id: "no_entry",
95+
url: `${import.meta.env.BASE_URL}/filters/no_entry_icon.gif`,
96+
},
97+
{
98+
id: "bus_gate",
99+
url: `${import.meta.env.BASE_URL}/filters/bus_gate_icon.gif`,
100+
},
101+
{
102+
id: "school_street",
103+
url: `${import.meta.env.BASE_URL}/filters/school_street_icon.gif`,
104+
},
93105
]}
94106
>
95107
<div bind:this={mapDiv} />

web/src/edit/ChangeModalFilter.svelte

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<script lang="ts">
22
import { Modal, notNull } from "../common";
33
4+
// TODO Use of import.meta.env.BASE_URL below is to workaround https://github.com/vitejs/vite/issues/10601
5+
46
export let filterType: string;
57
68
let choices = [
@@ -41,17 +43,17 @@
4143
disabled={filterType == name}
4244
on:click={() => (filterType = name)}
4345
><img
44-
src={`/filters/${name}_icon.gif`}
46+
src={`${import.meta.env.BASE_URL}/filters/${name}_icon.gif`}
4547
width="80"
4648
alt={label}
47-
/><br/>{label}</button
49+
/><br />{label}</button
4850
>
4951
</div>
5052
{/each}
5153
</td>
5254
<td>
5355
<img
54-
src={`/filters/${filterType}.gif`}
56+
src={`${import.meta.env.BASE_URL}/filters/${filterType}.gif`}
5557
height="300"
5658
alt={currentTriple[1]}
5759
/>

0 commit comments

Comments
 (0)