From 485ca4a6c69737d41dd71d8206ffc901505acded Mon Sep 17 00:00:00 2001 From: Ryan Miller Date: Thu, 10 Oct 2024 08:01:44 -0400 Subject: [PATCH] fix issue with fetch path --- src/main.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 9439a45..c60c2a5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,6 +3,7 @@ import {initShaderProgram} from "./shader-util.ts"; import {mat4} from 'gl-matrix'; +const env = import.meta.env @@ -70,8 +71,8 @@ function main() { gl.depthFunc(gl.LEQUAL) //Near objects obscure distant ones - const vertShaderPromise = fetch('/shaders/shader.vert').then(file => file.text()); - const fragShaderPromise = fetch('/shaders/shader.frag').then(file => file.text()); + const vertShaderPromise = fetch(env.BASE_URL + 'shaders/shader.vert').then(file => file.text()); + const fragShaderPromise = fetch(env.BASE_URL + 'shaders/shader.frag').then(file => file.text()); Promise.all([vertShaderPromise, fragShaderPromise]).then(shaderStrings => { const shaderProgram = initShaderProgram(gl, shaderStrings[0], shaderStrings[1]); if (!shaderProgram) {