You can change the KhronosTextureContainer2.URLConfig
KhronosTextureContainer2 | Babylon.js Documentation
i.e. KhronosTextureContainer2.URLConfig.jsDecoderModule = "https://somewebsite.com/babylon.ktx2Decoder.js"
.
However I wasn’t able to get the files relatively from the local project, it has to be an absolute path. As described in this Thread. I now set the paths by getting document.location.origin
and adding to that.