/** * Libraries this site serves itself, under /vendor/npm/, rather than loading * them from jsDelivr at run time: an import() cannot carry an SRI hash, so a * module fetched from the CDN was trusted blind (4 Oct 2026), and since * 1 Nov 2026 every classic script, stylesheet, font and data file too, as * jsDelivr is unreliable from China. scripts/vendor.mjs and vendor.json say * what is there and how it is kept honest (generated modules committed, * package files checked against hashes at every build); a file named here * gets its lock hash as SRI too (shared/sri.ts integrityOf). * * Paths are as on jsDelivr ("mdb-reader@3.2.0/+esm", or "gh//@/..." * for a file from GitHub). The address is absolute * because some are imported from workers made from blob: URLs, where a path * beginning with "/" has no page to be relative to. */ export function vendored(path: string): string { const file = path.replace(/\/\+esm$/, '/+esm.mjs'); // Under prerendering there is no location; nothing is imported there anyway. const origin = typeof location === 'undefined' ? 'https://johnmcm.com' : location.origin; return `${origin}/vendor/npm/${file}`; }