Skip to content

Including external files and Hype extensions

Max Ziebell edited this page Dec 19, 2019 · 9 revisions

This is an overview on ways to include external files (JavaScript, CSS etc.) and Hype Extensions into your Hype project.

Using code from GitHub with jsDelivr

Using jsDelivr's global Content Delivery Network (CDN) has some benefits. It is the current delivery network of choice used by Tumult Hype to deliver the Hype Runtime when using the CDN option in extend export.

Benefits

  • delivery speed and load balancing across mirror site around the globe

Drawbacks

  • external server dependency (although in most cases a CDN beats personal hosting)
  • currently it is a free service but it includes the risk of maybe costing money or being shut down one day

Example

In the following example we are going to include the Hype Extension Hype MissingSelectors by copying the following HTML into the head section of our project.

<script src="https://cdn.jsdelivr.net/gh/worldoptimizer/HypeMissingSelectors/HypeMissingSelectors.min.js"></script>

Optionally you can also link a SRI version or specific releases. Read more about that on the JsDelivr (CDN) page for this extension at https://www.jsdelivr.com/package/gh/worldoptimizer/HypeMissingSelectors

Clone this wiki locally