An esbuild plugin (v2.0.0) that intercepts import statements and resolves them to CDN URLs (esm.sh, unpkg, jsdelivr, skypack), enabling browser-side module resolution without a filesystem. Requires esbuild >=0.20.0 and Node >=18. Ships TypeScript types. Key differentiator: supports multiple CDNs and per-package version pinning, but some dependencies may not work from a CDN.
npm install esbuild-plugin-cdn-importsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures esbuild to replace imports of 'react' and 'react-dom' with esm.sh CDN URLs, excluding '@prisma/client' from transformation.
Upgrade Node.js to version 18 or later.
Update esbuild to version 0.20.0 or later.
Upgrade esbuild to at least 0.19.0.
Use the 'exclude' option to bypass CDN resolution for incompatible packages, or verify CDN compatibility beforehand.
Use import syntax instead of require(), or set your project's type to module.
Prefer 'esm' or 'jsdelivr' CDN options.
Run 'npm install -D esbuild esbuild-plugin-cdn-imports'.
Use 'import { CDNImports } from 'esbuild-plugin-cdn-imports''.Use one of: 'esm', 'unpkg', 'jsdelivr', 'skypack'.
Switch to ES module imports or set 'type': 'module' in package.json.