From a10ea3b7dd3e4ca834cf2d83e6e7b55cda09f84b Mon Sep 17 00:00:00 2001 From: Lizzy Hunt Date: Sat, 9 Mar 2024 22:19:26 -0700 Subject: [PATCH] fix meta env path --- src/engine/config/assets.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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();