Skip to content
PluginStats

vite-plugin-external weekly downloads statistics

By fengxinming (2 listings) · npm · Vite plugins

Excludes specified module dependencies from runtime code and built bundles.

View on npm Fresh · Dec 6, 2026

vite-plugin-external has 14,233 recorded weekly downloads on npm, a decrease of 16.6% over the past 30 days, ranking #1157 of 3,247 tracked listings.

Weekly downloads
14,233
Official API · Dec 5, 2026
7-day growth
+23.6%
+2.7K weekly downloads
30-day growth
-16.6%
-2.8K weekly downloads
90-day growth
+18.7%
+2.2K weekly downloads
Rank
#1157
▲ 33 in 7 days

About vite-plugin-external

vite-plugin-external

npm package

NPM version NPM Downloads Node version

Excludes specified module dependencies from runtime code and built bundles. Vite >= 8.0

Documentation

For detailed usage instructions and API references, please visit the official documentation:

👉 View Full Documentation

Quick Start

Prerequisite: provide the globals in index.html

Global-name externals (e.g. react: 'React') only take effect if the global variable actually exists at runtime — the plugin rewrites the import to a global lookup, it does not download anything. So load the UMD builds in index.html before writing the config, and keep the window names aligned with the values in externals:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>demo</title>
  <!-- CDN UMD builds provide window.React / window.ReactDOM -->
  <script crossorigin src="https://unpkg.com/umd-react/dist/react.production.min.js"></script>
  <script crossorigin src="https://unpkg.com/umd-react/dist/react-dom.production.min.js"></script>
</head>
<body>
  <div id="app"></div>
  <script type="module" src="/src/index.tsx"></script>
</body>
</html>

The same rule applies to per-mode (development / production) overrides: every mode's global names must exist on window in that environment. Externals whose value is an ESM CDN URL are the exception — nothing to add manually: in a build the bundle imports the absolute CDN URLs directly and the plugin injects <link rel="modulepreload"> for first-paint prefetching; with importmap: true (example 5 below) the addresses move out of the bundle into an injected <script type="importmap">.

1. IIFE build with global variables (application build)

import { defineConfig } from 'vite';
import pluginExternal from 'vite-plugin-external';

export default defineConfig({
  plugins: [
    pluginExternal({
      externals: {
        react: 'React',
        'react-dom': 'ReactDOM',
        'react-dom/client': 'ReactDOM'
      }
    })
  ],
  build: {
    rolldownOptions: {
      output: {
        format: 'iife'
      }
    }
  }
});

2. Function-style externals (dynamic mapping, lib build)

(source, importer, isResolved) — return a string (global name / CDN URL), an ExternalEsConfig ({ format: 'es', url, exports? }, where exports is 'auto' | 'named' | 'default' | 'none'), true (pure external), or a falsy value to let it resolve normally. IIFE lib builds need build.lib.name:

import { defineConfig } from 'vite';
import pluginExternal from 'vite-plugin-external';

export default defineConfig({
  plugins: [
    pluginExternal({
      externals(source) {
        if (source.startsWith('@scope/')) {
          const name = source.split('/').pop();
          return `Scope${name.charAt(0).toUpperCase()}${name.slice(1)}`;
        }
        if (source === 'react') return 'React';
        if (source === 'react-dom/client') return 'ReactDOM';
        return null;
      }
    })
  ],
  build: {
    lib: {
      entry: 'src/main.tsx',
      formats: ['iife'],
      name: 'ScopedApp'
    }
  }
});

3. ESM CDN URLs (auto <link rel="modulepreload"> injection)

import { defineConfig } from 'vite';
import pluginExternal from 'vite-plugin-external';

export default defineConfig({
  plugins: [
    pluginExternal({
      externals: {
        react: 'https://esm.sh/react@19.3.1',
        'react-dom/client': 'https://esm.sh/react-dom@19.3.1/client',
        // the automatic JSX runtime is a separate module id — list it too
        'react/jsx-runtime': 'https://esm.sh/react@19.3.1/jsx-runtime'
      }
    })
  ]
});

4. externalizeDeps — pure external without shim (dev and build)

import { defineConfig } from 'vite';
import pluginExternal from 'vite-plugin-external';

export default defineConfig({
  plugins: [
    pluginExternal({
      externalizeDeps: ['lodash', 'dayjs', /^@babel\//]
    })
  ],
  build: {
    lib: {
      entry: 'src/main.ts',
      formats: ['es'],
      fileName: 'my-lib'
    }
  }
});

Pure external leaves a bare specifier, so the consumer has to supply the address itself: a Node host resolves it from node_modules, and a dev-server page needs a <script type="importmap"> whose keys match what the browser actually requests — Vite 8 rewrites an externalized bare specifier to /@id/<specifier>, so the keys must carry that prefix ({"imports": {"/@id/lodash": "https://esm.sh/lodash@4.18.1"}}).

5. importmap: true — CDN externals become an import map

import { defineConfig } from 'vite';
import pluginExternal from 'vite-plugin-external';

export default defineConfig({
  plugins: [
    pluginExternal({
      externals: {
        lodash: 'https://esm.sh/lodash@4.18.1',
        dayjs: 'https://esm.sh/dayjs@1.11.23'
      },
      importmap: true
    })
  ]
});
```…

Description from the npm listing.

  • vite
  • vite-plugin
  • vite-plugin-external

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

vite-plugin-external weekly downloads on npm, last 90 days: 14,233 weekly downloads as of Dec 5, 2026, +18.7% over 90 days.vite-plugin-externalWeekly downloads on npm · Last 90 days14,233downloads / week+18.7% over 90 days05K10K15K20KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
vite-plugin-external weekly downloads on npm, last 90 days: 14,233 weekly downloads as of Dec 5, 2026, +18.7% over 90 days.

7/30/90-day growth

vite-plugin-external weekly downloads growth on npm: +23.6% over 7 days, -16.6% over 30 days, +18.7% over 90 days.vite-plugin-externalWeekly downloads growth on npm14,233downloads / week now7-day growth+2,722 weekly downloads+23.6%30-day growth-2,836 weekly downloads-16.6%90-day growth+2,245 weekly downloads+18.7%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
vite-plugin-external weekly downloads growth on npm: +23.6% over 7 days, -16.6% over 30 days, +18.7% over 90 days.

Ranking history

vite-plugin-external npm ranking history: currently #1157 (by weekly downloads).vite-plugin-externalnpm ranking · by weekly downloads · Last 90 days#1157current rank#900#950#1000#1050#1100#1150#1200Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
vite-plugin-external npm ranking history: currently #1157 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 58, #17 (overall #1,157)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins300 listings · 15 pages · page 11, #2 (overall #202)
Vite plugins: every listing in weekly downloads order

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 (170)
Recent weekly downloads observations for vite-plugin-external
Date (UTC)Weekly downloadsChange vs. previous
14,233+223
14,010+751
13,259+526
12,733-323
13,056+878
12,178+512
11,666+155
11,511+166
11,345-214
11,559-367
11,926+358
11,568-26
11,594-146
11,740—

Similar npm Vite plugins plugins

All 20 vite-plugin-external alternatives

Data 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/vite-plugin-external. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.