Export Script: How to detect if user has selected Hype JS to be served from CDN

Hello

I am trying to write a custom export script, but haven't been able to figure this out from the documentation or by looking at other export scripts. If the User has selected CDN option for serving Hype JS, how can the export script know about it.

I can see that this is causing a bug in the current OrganizedAssets export script as well. If I try to export a scene using OrganizedAssets with CDN selected, then the exported bundle does not load. It ends up referencing
https://cdn.jsdelivr.net/gh/tumult/hype-runtime/js/HYPE-674.thin.min.js
instead of
https://cdn.jsdelivr.net/gh/tumult/hype-runtime/HYPE-674.thin.min.js
(extra /js in the URL)

This is because it does not check when rewriting the path for Hype JS, whether the user has selected CDN or not, and thus appends /js to that path as well.

1 Like

Unfortunately there is not a way to know right now. I've filed a bug in our system to figure out a good way to expose this.

I think the best workaround for now would be to look for the string in the .html and possible *_hype_generated_script.js and do a text replacement. (I'd put this in the --modify_staging_path section).

Makes sense. Will try that. :+1: