Skip to content
PluginStats

rollup-plugin-node-externals weekly downloads statistics

By Septh · npm · Vite plugins

Automatically declare NodeJS built-in modules and npm dependencies as 'external' in Rollup/Vite config

View on npm Fresh · Oct 17, 2026

rollup-plugin-node-externals has 107,762 recorded weekly downloads on npm, a decrease of 59.1% over the past 30 days.

It ranks #441 of 2,251 tracked npm listings by weekly downloads.

Over 90 days, weekly downloads changed by -61.5%.

PluginStats has 121 daily observations since Jun 19, 2026; the latest is from Oct 17, 2026.

Weekly downloads
107,762
Official API · Oct 17, 2026
7-day growth
-54.7%
-129.9K weekly downloads
30-day growth
-59.1%
-155.4K weekly downloads
90-day growth
-61.5%
-172.3K weekly downloads
Rank
#441
Among tracked npm listings

About rollup-plugin-node-externals

rollup-plugin-node-externals

A Rollup/Vite plugin that automatically declares NodeJS built-in modules and npm dependencies as external. • Ultra-lightweight: less than 10 kB download, less than 25 kB unpacked. • Zero runtime dependencies. • Works in monorepos. • Works with all package managers.

Why you need this

(click to read if you're wondering)

By default, Rollup doesn't know a thing about NodeJS, so trying to bundle simple things like import path from 'node:path' in your code results in an Unresolved dependencies warning.

The solution here is quite simple: you must tell Rollup that the node:path module is in fact _external_. This way, Rollup won't try to bundle it in and rather leave the import statement as is (or translate it to a require() call if bundling for CommonJS).

However, this must be done for each and every NodeJS built-in you happen to use in your program: node:path, node:os, node:fs, node:url, etc., which can quickly become cumbersome when done manually.

So the primary goal of this plugin is simply to automatically declare all NodeJS built-in modules as external. As an added bonus, this plugin will also declare your dependencies (as per your local or monorepo package.json file(s)) as external.

Requirements

• Rollup >= 4 or Vite >= 5 • NodeJS >= 24

Installation

Use your favorite package manager. Mine is npm:

Usage

Import

The plugin is available both as the default export and as a named export:

and

will both work.

Options

You generally want to have your _runtime dependencies_ (those that will be imported/required at runtime) listed under dependencies in package.json, and your _development dependencies_ (those that should be bundled in by Rollup/Vite) listed under devDependencies.

If you follow this simple rule, then the default settings are just what you need:

This will bundle your devDependencies in while leaving your dependencies, peerDependencies and optionalDependencies external.

Should the defaults not suit your case, here is the full list of options.

builtins?: boolean = true

Set the builtins option to false if you'd like to use some shims/polyfills for those. You'll most certainly need an other plugin as well.

builtinsPrefix?: boolean | 'add' | 'strip' | 'ignore' = 'add'

How to handle the node: scheme when importing builtins (i.e., import path from 'node:path'). • If add or true (the default, recommended), the node: scheme is always added if missing, so path becomes node:path. In effect, this dedupes your imports of Node builtins by homogenizing their names to their schemed version. • If strip or false, the scheme is always removed, so node:path becomes path. In effect, this dedupes your imports of Node builtins by homogenizing their names to their scheme-less version. Schemed-only builtins like node:test or node:sqlite are never stripped. • ignore will simply leave all builtins imports as written in your code. Caveat: if you write node:path but one of your bundled dependencies uses path (or the other way around), your bundle will end up with both node:path and path imports.

[!NOTE] Scheme handling is always applied, regardless of the builtins options being enabled or not.

packagePath?: string | string[] = []

This option allows you to specify which package.json file(s) should be scanned for dependencies.

If not specified, the default is to start with the current directory's package.json then go up scan for all package.json files in parent directories recursively until either the root git directory is reached, the root of the monorepo is reached, or no other package.json can be found.

deps?: boolean = true devDeps?: boolean = false peerDeps?: boolean = true optDeps?: boolean = true

Set the deps, devDeps, peerDeps and optDeps options to false to prevent the corresponding dependencies from being externalized, therefore letting Rollup/Vite bundle them with your code.

include?: string | RegExp | (string | RegExp)[] = []

Use the include option to force include certain dependencies into the list of externals regardless of other settings:

exclude?: string | RegExp | (string | RegExp)[] = []

Conversely, use the exclude option to remove certain dependencies from the list of externals regardless of other settings:

Notes

1/ This plugin is smart

• Falsy values in include and exclude are silently ignored. This allows for conditional constructs like exclude: process.env.NODE_ENV === 'production' && 'my-prod-only-dep'. • Subpath imports are supported with regexes, meaning that include: /^lodash/ will externalize lodash and also lodash/map, lodash/merge, etc.

2/ This plugin is not _that_ smart

It uses an exact match against your imports _as written in your code_. No resolving of path aliases or substitutions is made.

3/ Order matters

If you're also using @rollup/plugin-node-resolve, make sure this plugin comes _before_ it in the plugins array:

Note that as of version 7.1, this plugin has a enforce: 'pre' property that will make Rollup and Vite call it very early in the module resolution process. Nevertheless, it is best to always make this plugin the first one in the plugins array.

4/ Rollup rules

Rollup's own external configuration option always takes precedence over this plugin. This is intentional.

5/ Using with Vite

This plugin has been compatible with Vite out-of-the-box since version 7.1. If you found an old tutorial on the Internet telling you to use some special trick to make it work with Vite… just don't. Here's how you should write your vite.config.js:

[!IMPORTANT] Make sure you use the _top-level plugins array_ in vite.config.js as shown above. Using build.rollupOptions.plugins will probably not work. See #35 for details.

What's new in v9

This version mainly enhances performance when used in watch mode. This was achieved by ensuring that the buildStart hook builds the full dependencies list only when necessary.

Breaking changes…

Description from the npm listing.

  • rollup
  • vite
  • plugin
  • rollup-plugin
  • vite-plugin
  • external
  • externals
  • node
  • builtin
  • builtins
  • dependencies
  • devDependencies
  • peerDependencies
  • optionalDependencies
  • modules
  • monorepo

Where rollup-plugin-node-externals sits in the listing

Each band is one page of 20. Weekly downloads on a log 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.

All npm2,248 listings · 113 pages · page 23, #1 (overall #441)
All npm: every listing in weekly downloads order
PNG SVG
Vite plugins250 listings · 13 pages · page 3, #19 (overall #59)
Vite plugins: every listing in weekly downloads order
PNG SVG

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

rollup-plugin-node-externals weekly downloads on npm, last 90 days: 107,762 weekly downloads as of Oct 17, 2026, -61.5% over 90 days.rollup-plugin-node-externalsWeekly downloads on npm · Last 90 days107,762downloads / week-61.5% over 90 days100K150K200K250K300K350KJul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 20, 2026 – Oct 17, 2026 · 90 observations · Updated Oc…pluginstats.com
rollup-plugin-node-externals weekly downloads on npm, last 90 days: 107,762 weekly downloads as of Oct 17, 2026, -61.5% over 90 days.
PNG SVG

7/30/90-day growth

rollup-plugin-node-externals weekly downloads growth on npm: -54.7% over 7 days, -59.1% over 30 days, -61.5% over 90 days.rollup-plugin-node-externalsWeekly downloads growth on npm107,762downloads / week now7-day growth-129,949 weekly downloads-54.7%30-day growth-155,430 weekly downloads-59.1%90-day growth-172,341 weekly downloads-61.5%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
rollup-plugin-node-externals weekly downloads growth on npm: -54.7% over 7 days, -59.1% over 30 days, -61.5% over 90 days.
PNG SVG

Ranking history

rollup-plugin-node-externals npm ranking history: currently #441 (by weekly downloads).rollup-plugin-node-externalsnpm ranking · by weekly downloads · Last 90 days#441current rank#439#440#441#442#443Jul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18rankOct 18, 2026 – Oct 18, 2026 · 1 observations · Updated Oct 17, 2026pluginstats.com
rollup-plugin-node-externals npm ranking history: currently #441 (by weekly downloads).
PNG SVG

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.

Recent observations

Full history (121)
Recent weekly downloads observations for rollup-plugin-node-externals
Date (UTC)Weekly downloadsChange vs. previous
107,762-19.7K
127,438-2.7K
130,108-50.5K
180,602-52K
232,6120
232,612-4.6K
237,166-545
237,711+999
236,712+9.5K
227,241+5.6K
221,606+4.2K
217,414-47K
264,440-4.4K
268,884—

Similar npm Vite plugins plugins

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/rollup-plugin-node-externals. First seen Oct 16, 2026; last successful collection Oct 18, 2026. See the methodology.