Skip to content

Instantly share code, notes, and snippets.

@jcubic
Last active November 13, 2024 22:56
Show Gist options
  • Save jcubic/a8b8c979d200ffde13cc08505f7a6436 to your computer and use it in GitHub Desktop.
Save jcubic/a8b8c979d200ffde13cc08505f7a6436 to your computer and use it in GitHub Desktop.
How to setup a literally free CDN
@lopugit
Copy link

lopugit commented Feb 13, 2024

@jcubic oh awesome! πŸ™

Man, thank you so much for making this gist, this github -> cdn thing has helped me so much, if you use babel standalone, you can basically create full React typescript apps and make them embeddable using just <script src , combined with importing esm modules via esm cdn, it's incredible

          await loadScript("https://unpkg.com/@babel/standalone/babel.min.js", "text/javascript")
          
          await loadScript({ content: `
          
            import React from "https://esm.sh/react@18";
            window.React = React

Take a look here for example.

https://github.com/lopugit/mods/blob/v1.0.16/maccas.js

@jcubic
Copy link
Author

jcubic commented Feb 13, 2024

@lopugit I don't understand what your code is supposed to do, but I'm glad that you find my gist useful.

@lopugit
Copy link

lopugit commented Feb 13, 2024

@jcubic πŸ˜‚ πŸ™ πŸ’― πŸš€ πŸ‘

@Mugane
Copy link

Mugane commented Jun 21, 2024

Is it actually free though? Isn't Github (or whoever) paying for the service? Isn't this a violation of their terms of use?

@jcubic
Copy link
Author

jcubic commented Jun 21, 2024

@Mugane Sorry I'm not a lawyer. But this has nothing to do with GitHub, JSDelivr is donated to the public, all services give the service are donated to community. JSDelivr don't pay the Cloudflare bill.

@Mugane
Copy link

Mugane commented Jun 21, 2024

Ah, yes you are right. Neat!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment