GLTF loader fetch zipped model

I’m using the gltf-transform CLI to compress several GLB models and then zipped them manually.

Because my CDN provider doesn’t support gzip, I have to use regular zipped files.
However I’m unable to find any instructions on how to load a zipped GLB model using the Three JS GLTF loader.

Does the GLTF loader support loading zipped GLB models? If so, is there any instructions on how to achieve this?

Thank You!

The three.js editor support zipped glTF assets. I suggest you study the related code in Loader.js:

Thank you for your reply. I tried loading a zipped file like this:

var three_load = new THREE.Loader();

three_load.load('', function (result) {

But nothing happens for some reason. I’m I using the Loader.js wrong?

I also tried using FileLoader instead and managed to load the zipped file.

However the results are scrambled like this:


And passing the above result into gltf_loader.parse() results in:

Unhandled Promise Rejection: SyntaxError: JSON Parse error: Unexpected identifier PK