diff --git a/src/engine/config/assets.ts b/src/engine/config/assets.ts index 9731ad7..bf7981a 100644 --- a/src/engine/config/assets.ts +++ b/src/engine/config/assets.ts @@ -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();