Skip to content
PluginStats

vite-plugin-commonjs-externals weekly downloads statistics

By xiaoxiangmoe · npm · Vite plugins

Provides commonjs externals support for Vite.

View on npm Fresh · Dec 6, 2026

vite-plugin-commonjs-externals has 5,916 recorded weekly downloads on npm, an increase of 6.3% over the past 30 days, ranking #1466 of 3,247 tracked listings.

Weekly downloads
5,916
Official API · Dec 5, 2026
7-day growth
-16.0%
-1.1K weekly downloads
30-day growth
+6.3%
+349 weekly downloads
90-day growth
+69.0%
+2.4K weekly downloads
Rank
#1466
▼ 95 in 7 days

About vite-plugin-commonjs-externals

vite-plugin-commonjs-externals npm

Provides commonjs externals support for Vite.

Description

Prevent bundling of certain esm imported packages and instead retrieve these external dependencies at runtime by commonjs require.

For example:

import commonjsExternals from 'vite-plugin-commonjs-externals';

const externals = ['path', /^electron(\/.+)?$/];

export default {
  optimizeDeps: {
    exclude: externals,
  },
  plugins: commonjsExternals({
    externals,
  }),
};

This will convert it

import fs from 'fs';
import * as path from 'path';
import e1 from 'electron';
import e2, * as e3 from 'electron/main';

console.log({ fs, path, e1, e2, e3 });

to

import * as fs from 'fs';
const path = (() => {
  const mod = require('path');
  return mod?.__esModule
    ? mod
    : Object.assign(Object.create(null), mod, {
        default: mod,
        [Symbol.toStringTag]: 'Module',
      });
})();
const { default: e1 } = (() => {
  const mod = require('electron');
  return mod?.__esModule
    ? mod
    : Object.assign(Object.create(null), mod, {
        default: mod,
        [Symbol.toStringTag]: 'Module',
      });
})();
const e3 = (() => {
  const mod = require('electron/main');
  return mod?.__esModule
    ? mod
    : Object.assign(Object.create(null), mod, {
        default: mod,
        [Symbol.toStringTag]: 'Module',
      });
})();
const { default: e2 } = e3;
console.log({ fs, path, e1, e2, e3 });

React + Electron renderer Config Example

// vite.config.ts
import { defineConfig } from 'vite';
import { escapeRegExp } from 'lodash';
import reactRefresh from '@vitejs/plugin-react-refresh';
import builtinModules from 'builtin-modules';
// For two package.json structure
import pkg from '../the-path-to-main-process-dir/package.json';
// For single package.json structure
import pkg from './package.json';
import commonjsExternals from 'vite-plugin-commonjs-externals';

const commonjsPackages = [
  'electron',
  'electron/main',
  'electron/common',
  'electron/renderer',
  'original-fs',
  ...builtinModules,
  ...Object.keys(pkg.dependencies).map(
    name => new RegExp('^' + escapeRegExp(name) + '(\\/.+)?$')
  ),
] as const;

export default defineConfig({
  optimizeDeps: {
    exclude: commonjsPackages,
  },
  plugins: [reactRefresh(), commonjsExternals({ externals: commonjsPackages })],
});

Description from the npm listing.

  • vite-plugin
  • commonjs

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-commonjs-externals weekly downloads on npm, last 90 days: 5,916 weekly downloads as of Dec 5, 2026, +69.0% over 90 days.vite-plugin-commonjs-externalsWeekly downloads on npm · Last 90 days5,916downloads / week+69.0% over 90 days02K4K6K8K10K12K14K16KSep 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-commonjs-externals weekly downloads on npm, last 90 days: 5,916 weekly downloads as of Dec 5, 2026, +69.0% over 90 days.

7/30/90-day growth

vite-plugin-commonjs-externals weekly downloads growth on npm: -16.0% over 7 days, +6.3% over 30 days, +69.0% over 90 days.vite-plugin-commonjs-externalsWeekly downloads growth on npm5,916downloads / week now7-day growth-1,127 weekly downloads-16.0%30-day growth+349 weekly downloads+6.3%90-day growth+2,415 weekly downloads+69.0%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
vite-plugin-commonjs-externals weekly downloads growth on npm: -16.0% over 7 days, +6.3% over 30 days, +69.0% over 90 days.

Ranking history

vite-plugin-commonjs-externals npm ranking history: currently #1466 (by weekly downloads).vite-plugin-commonjs-externalsnpm ranking · by weekly downloads · Last 90 days#1466current rank#1000#1100#1200#1300#1400#1500Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
vite-plugin-commonjs-externals npm ranking history: currently #1466 (by weekly downloads).

Listing placement

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

Listing placement

Vite plugins300 listings · 15 pages · page 14, #4 (overall #264)
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-commonjs-externals
Date (UTC)Weekly downloadsChange vs. previous
5,916-36
5,952+236
5,716-818
6,534-534
7,068-92
7,160+431
6,729-314
7,043-720
7,763-813
8,576-1.7K
10,253-2.1K
12,400-2.6K
15,006-860
15,866—

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