fix meta env path
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Elizabeth Hunt 2024-03-09 22:19:26 -07:00
parent a42d1d0323
commit a10ea3b7dd
Signed by: simponic
GPG Key ID: 52B3774857EB24B1

View File

@ -1,7 +1,7 @@
import { type SpriteSpec, SPRITE_SPECS } from ".";
import { SOUND_SPECS, SoundSpec } from "./sounds";
const BASE_URL = import.meta.env.BASE_URL ?? document.location;
const BASE_URL = import.meta.env.BASE_URL;
export const FONT = new FontFace(
"scientifica",
@ -22,7 +22,7 @@ export const loadSpritesIntoImageElements = (
for (const spriteSpec of spriteSpecs) {
if (spriteSpec.sheet) {
const img = new Image();
img.src = BASE_URL + spriteSpec.sheet;
img.src = document.location + spriteSpec.sheet;
IMAGES.set(spriteSpec.sheet, img);
spritePromises.push(
@ -49,7 +49,7 @@ export const loadSoundsIntoAudioElements = (
for (const soundSpec of soundSpecs) {
if (soundSpec.url) {
const promise = fetch(BASE_URL + soundSpec.url)
const promise = fetch(document.location + soundSpec.url)
.then((response) => response.blob())
.then((blob) => {
const audio = new Audio();