@cyrus-dev/unplugin-cdn weekly downloads statistics
By cyrus-dev · npm · Webpack plugins
Universal CDN externalization and HTML asset injection plugin for Vite, Webpack, Rspack, Rollup, Rolldown, esbuild, and Farm
@cyrus-dev/unplugin-cdn has 23 recorded weekly downloads on npm, a change of -32.4% over the past 7 days, ranking #2966 of 3,247 tracked listings.
About @cyrus-dev/unplugin-cdn
@cyrus-dev/unplugin-cdn
English | 简体中文
Universal CDN plugin powered by unplugin. During local development (dev / serve), imports resolve directly from node_modules. During production builds (build), specified packages are excluded from the bundle and automatically injected into HTML via CDN <script> / <link> tags or <script type="importmap">.
Supports Vite, Webpack, Rspack, Rsbuild, Rollup, Rolldown, esbuild, Farm, and Bun.
Installation
pnpm add -D @cyrus-dev/unplugin-cdn
Usage
Vite
// vite.config.ts
import cdn from "@cyrus-dev/unplugin-cdn/vite"
import { defineConfig } from "vite"
export default defineConfig({
plugins: [
cdn({
provider: "jsdelivr",
format: "umd",
modules: [
"react",
"react-dom",
"shadcn",
"tanstack-*",
"zustand",
"zod",
"supabase",
"motion",
],
}),
],
})
Webpack / Rspack
// webpack.config.js or rspack.config.js
import cdn from "@cyrus-dev/unplugin-cdn/webpack" // or "@cyrus-dev/unplugin-cdn/rspack"
export default {
mode: "production",
plugins: [
cdn({
modules: ["react", "react-dom", "ant-design", "dayjs"],
}),
],
}
Rsbuild
// rsbuild.config.ts
import cdn from "@cyrus-dev/unplugin-cdn/rsbuild"
import { defineConfig } from "@rsbuild/core"
export default defineConfig({
plugins: [
cdn({
modules: ["react", "react-dom", "recharts"],
}),
],
})
Rollup / Rolldown
// rollup.config.js or rolldown.config.js
import cdn from "@cyrus-dev/unplugin-cdn/rollup" // or "@cyrus-dev/unplugin-cdn/rolldown"
export default {
plugins: [
cdn({
modules: ["lodash", "axios"],
}),
],
}
esbuild / Farm / Bun
import cdnEsbuild from "@cyrus-dev/unplugin-cdn/esbuild"
import cdnFarm from "@cyrus-dev/unplugin-cdn/farm"
import cdnBun from "@cyrus-dev/unplugin-cdn/bun"
Loading Modes (format)
"umd"(default): Maps module imports (both default and named exports) to global variables onglobalThisvia virtual shim modules and injects<script src="...">and<link rel="stylesheet" href="...">into HTML before bundle scripts. Modern packages that only publish ESM (such aszustand,zod,@tanstack/*,radix-ui,motion,recharts) automatically fall back to native ESM +importmap."esm": Marks modules as native ESM externals and injects<script type="importmap">into HTML (defaults toesm.sh).
Built-in Presets & Group Aliases
Versions are automatically read from your project's installed node_modules/<name>/package.json so the CDN version always matches local development.
Group & Wildcard Presets (Auto-detects installed packages)
| Group / Pattern | Expanded Packages |
|---|---|
shadcn | radix-ui, @radix-ui/*, clsx, tailwind-merge, class-variance-authority, lucide-react |
cn | clsx, tailwind-merge, class-variance-authority |
tanstack-* / @tanstack/* | All installed @tanstack/* packages (@tanstack/react-query, @tanstack/react-router, @tanstack/react-table, @tanstack/react-virtual, @tanstack/react-form, etc.) |
ant-design | antd, @ant-design/icons |
base-ui | @base-ui/react, @base-ui-components/react |
aria-ui | react-aria-components, react-aria, react-stately |
supabase | @supabase/supabase-js |
tailwindcss | @tailwindcss/browser |
Individual Package Presets
- Vue Ecosystem:
vue,vue-router,pinia,vue-demi,@vueuse/core,@vueuse/shared,element-plus,naive-ui,vant - React & State:
react,react-dom,react-router,react-router-dom,zustand,immer,swr,ahooks,@tanstack/* - UI & Styling:
antd,@ant-design/icons,radix-ui,@radix-ui/*,@base-ui/react,react-aria-components,lucide-react,@heroicons/react,clsx,tailwind-merge,class-variance-authority,@tailwindcss/browser - Validation, BaaS & Utils:
zod,@supabase/supabase-js,nanoid,uuid,axios,lodash,lodash-es,dayjs,moment,date-fns,rxjs - Charts, Motion & 3D:
recharts,echarts,d3,chart.js,motion,framer-motion,gsap,three,@react-three/fiber,@react-three/drei,pixi.js,konva - DOM & Rich Content:
jquery,sortablejs,marked,dompurify,highlight.js,katex
Options
| Option | Type | Default | Description |
|---|---|---|---|
modules | (string | CdnModuleConfig)[] | Required | Packages or preset groups to externalize and load from CDN |
provider | "jsdelivr" | "unpkg" | "esm.sh" | "cdnjs" | "npmmirror" | string | ((params) => string) | "jsdelivr" ("esm.sh" for ESM) | CDN provider preset, URL template ({name}, {version}, {path}), or builder function |
format | "umd" | "esm" | "umd" | Load via UMD globals + <script> or native ESM + importmap |
apply | boolean | "build" | "serve" | "build" | When to enable CDN replacement |
root | string | process.cwd() | Project root for resolving node_modules |
crossorigin | "" | "anonymous" | "use-credentials" | false | "anonymous" | crossorigin attribute on injected HTML tags |
injectHtml | boolean | true | Automatically inject <script> and <link> tags into generated HTML |
Description from the npm listing.
- bun-plugin
- cdn
- esbuild-plugin
- esm
- esm.sh
- externals
- farm-plugin
- importmap
- jsdelivr
- rolldown-plugin
- rollup-plugin
- rsbuild-plugin
- rspack-plugin
- umd
- unpkg
- unplugin
- vite-plugin
- webpack-plugin
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (128)Similar npm Webpack plugins plugins
All 20 @cyrus-dev/unplugin-cdn alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@cyrus-dev/unplugin-cdn. First seen Nov 25, 2026; last successful collection Dec 6, 2026. See the methodology.