Zend certified PHP/Magento developer

How to create a local callback to a JS via CDN using RequiredJS?

I’ve some JS files included in my themes and modules, but sometimes these files are not loaded, becaused of adblock or CDN server down. I checked the RequireJS documentation and I saw that it’s possible to create a local fallback of these files.

How could I include it in my themes and modules?

References: