Skip to content
PluginStats

vite-plugin-externals weekly downloads statistics

By crcong · npm · Vite plugins

externals plugin for vite

View on npm Fresh · Dec 6, 2026

vite-plugin-externals has 71,702 recorded weekly downloads on npm, a decrease of 43.9% over the past 30 days, ranking #698 of 3,247 tracked listings.

Weekly downloads
71,702
Official API · Dec 5, 2026
7-day growth
+5.5%
+3.7K weekly downloads
30-day growth
-43.9%
-56.1K weekly downloads
90-day growth
-40.0%
-47.9K weekly downloads
Rank
#698
▲ 1 in 7 days

About vite-plugin-externals

vite-plugin-externals

<p> <a href="https://www.npmjs.com/package/vite-plugin-externals" target="_blank"> <img alt="NPM package" src="https://img.shields.io/npm/v/vite-plugin-externals.svg?style=flat"> </a> <a href="https://www.npmjs.com/package/vite-plugin-externals" target="_blank"> <img alt="downloads" src="https://img.shields.io/npm/dt/vite-plugin-externals.svg?style=flat"> </a> <a href="https://github.com/vitejs/awesome-vite#helpers" target="_blank"> <img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome"> </a> </p>

English | 简体中文

use to external resources, like webpack externals, but only use in browser now.

Can be used in production mode without other rollup configuration.

but it will not take effect by default in commonjs, such as ssr.

Usage

npm i vite-plugin-externals -D

Add it to vite.config.js

// vite.config.js
import { viteExternalsPlugin } from 'vite-plugin-externals'

export default {
  plugins: [
    viteExternalsPlugin({
      vue: 'Vue',
      react: 'React',
      'react-dom': 'ReactDOM',
      // value support chain, transform to window['React']['lazy']
      lazy: ['React', 'lazy']
    }),
  ]
}

Warning: If you loaded production library in vite dev mode , may make HMR fail.

You can use disableInServe: true option to avoid transform in serve mode.

Eg.

<!-- may make HMR fail -->
<script src="./vue.global.prod.js"></script>

<!-- good -->
<script src="./vue.global.js"></script>

How to work

transform source code of js file.

// configuration
viteExternalsPlugin({
  vue: 'Vue',
}),
// source code
import Vue from 'vue'
// transformed
const Vue = window['Vue']

// source code
import { reactive, ref as r } from 'vue'
// transformed
const reactive = window['Vue'].reactive
const r = window['Vue'].ref

// source code
import * as vue from 'vue'
// transformed
const vue = window['Vue']

// source code
export { useState as _useState } from 'react'
// transformed
export const _useState = window['React'].useState

Warning: please use the plugin after converting to JS code, because the plugin only transform JS code. Eg.

import vue from '@vitejs/plugin-vue'

export default {
  plugins: [
    vue(), // @vitejs/plugin-vue will transform SFC to JS code

    // It should be under @vitejs/plugin-vue
    viteExternalsPlugin({
      vue: 'Vue',
    }),
  ]
}

If an error occurs, you can check whether the error is caused by the plugin order.

Configuration

disableInServe

disable transform in serve mode .

viteExternalsPlugin({
  vue: 'Vue',
}, { disableInServe: true })
enforce

vite plugin ordering. Resolve plugin ordering cause unexpected error. Such as #21.

See https://vitejs.dev/guide/api-plugin.html#plugin-ordering.

filter

The files in node_modules are filtered by default, and only transform js/ts/vue/jsx/tsx file.

You can specify the filter function. Return true will be transform to external.

viteExternalsPlugin({
  vue: 'Vue',
}, {
  filter(code, id, ssr) {
    // your code
    return false
  }
}),
useWindow

set false, the window prefix will not be added.

Warning: If your module name has special characters, such as /, set useWindow option false, will throw error.

viteExternalsPlugin({
  vue: 'Vue',
}, { useWindow: false }),

// source code
import Vue from 'vue'
// transformed, no `const Vue = window['Vue']`
const Vue = Vue
sourceMapOptions

The configuration item of the code sourcemap after code conversion. The library is magic-string.

Description from the npm listing.

  • vite-plugin
  • external
  • externals

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-externals weekly downloads on npm, last 90 days: 71,702 weekly downloads as of Dec 5, 2026, -40.0% over 90 days.vite-plugin-externalsWeekly downloads on npm · Last 90 days71,702downloads / week-40.0% over 90 days020K40K60K80K100K120K140KSep 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-externals weekly downloads on npm, last 90 days: 71,702 weekly downloads as of Dec 5, 2026, -40.0% over 90 days.

7/30/90-day growth

vite-plugin-externals weekly downloads growth on npm: +5.5% over 7 days, -43.9% over 30 days, -40.0% over 90 days.vite-plugin-externalsWeekly downloads growth on npm71,702downloads / week now7-day growth+3,732 weekly downloads+5.5%30-day growth-56,097 weekly downloads-43.9%90-day growth-47,895 weekly downloads-40.0%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
vite-plugin-externals weekly downloads growth on npm: +5.5% over 7 days, -43.9% over 30 days, -40.0% over 90 days.

Ranking history

vite-plugin-externals npm ranking history: currently #698 (by weekly downloads).vite-plugin-externalsnpm ranking · by weekly downloads · Last 90 days#698current rank#580#600#620#640#660#680#700#720Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
vite-plugin-externals npm ranking history: currently #698 (by weekly downloads).

Listing placement

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

Listing placement

Vite plugins300 listings · 15 pages · page 6, #19 (overall #119)
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-externals
Date (UTC)Weekly downloadsChange vs. previous
71,702+432
71,270+3K
68,243+2.1K
66,116+1.3K
64,836-594
65,430-259
65,689-2.3K
67,970-1.2K
69,134-3.2K
72,326-6.9K
79,271-4.9K
84,182-11.2K
95,380-6.3K
101,698—

Similar npm Vite plugins plugins

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