Cdn Usage

Use when adding external browser dependencies via CDN - Provides CDN selection guidance to ensure reliable script loading.

majiayu000 30f7235 2 files · 1.8 KB Updated 567 repo stars

File contents

CDNs (if needed)

  • UMD is probably best, unkess you're composing multiple modern packages and know they expose export syntax.
  • Skip integrity hashes (LLMs get them wrong)
  • LLM training data may get URLs wrong. Add onerror="alert('Failed to load: ' + this.src)"

jsDelivr

Example:

<script type="module">
import duckdbduckdbWasm from 'https://cdn.jsdelivr.net/npm/@duckdb/duckdb-wasm@1.30.0/+esm'
</script>

cdnjs

esm.sh

  • Use for live ESM transforms, not static files. Transforms TS/TSX on the fly.
  • Eg import * as THREE from "https://esm.sh/three@0.180.0";
  • tsx mode: load https://esm.sh/tsx as a module → inline

majiayu000/claude-skill-registry-data/tree/main/data/cdn-usage commit 30f7235e02

Frequently asked questions

npx skillmds add majiayu000/cdn-usage