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 · Dec 6, 2026

rollup-plugin-node-externals has 338,051 recorded weekly downloads on npm, an increase of 17.7% over the past 30 days, ranking #446 of 3,247 tracked listings.

Weekly downloads
338,051
Official API · Dec 5, 2026
7-day growth
+14.4%
+42.4K weekly downloads
30-day growth
+17.7%
+50.8K weekly downloads
90-day growth
+40.7%
+97.7K weekly downloads
Rank
#446
▲ 7 in 7 days

About rollup-plugin-node-externals

<p>

NPM Version Rollup 4.0 Vite 5.0 NPM Downloads NPM License

</p>

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

<details><summary>(click to read if you're wondering)</summary>

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.

</details>

Requirements

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

Installation

Use your favorite package manager. Mine is npm:

npm install --save-dev rollup-plugin-node-externals

Usage

Import

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

import nodeExternals from 'rollup-plugin-node-externals'

and

import { nodeExternals } from 'rollup-plugin-node-externals'

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:

// rollup.config.js / vite.config.js

export default {
  ...
  plugins: [
    nodeExternals(),
  ]
}

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.

import nodeExternals from 'rollup-plugin-node-externals'

export default {
  ...
  plugins: [
    nodeExternals({

      // Mark NodeJS builtins external. Default: true.
      builtins?: boolean

      // node: prefix handing for importing NodeJS builtins. Default: 'add'.
      builtinsPrefix?: boolean | 'add' | 'strip' | 'ignore'

      // The path(s) to your package.json. Default: read below.
      packagePath?: string | string[]

      // Mark dependencies external? Default: true.
      deps?: boolean

      // Mark devDependencies external? Default: false.
      devDeps?: boolean

      // Mark peerDependencies external? Default: true.
      peerDeps?: boolean

      // Mark optionalDependencies external? Default: true.
      optDeps?: boolean

      // Modules to force include in externals. Default: [].
      include?: string | RegExp | (string | RegExp)[]

      // Modules to force exclude from externals. Default: [].
      exclude?: string | RegExp | (string | RegExp)[]
    })
  ]
}
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<br>devDeps?: boolean = false<br>peerDeps?: boolean = true<br>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.…

Description from the npm listing.

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

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

rollup-plugin-node-externals weekly downloads on npm, last 90 days: 338,051 weekly downloads as of Dec 5, 2026, +40.7% over 90 days.rollup-plugin-node-externalsWeekly downloads on npm · Last 90 days338,051downloads / week+40.7% over 90 days050K100K150K200K250K300K350KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
rollup-plugin-node-externals weekly downloads on npm, last 90 days: 338,051 weekly downloads as of Dec 5, 2026, +40.7% over 90 days.

7/30/90-day growth

rollup-plugin-node-externals weekly downloads growth on npm: +14.4% over 7 days, +17.7% over 30 days, +40.7% over 90 days.rollup-plugin-node-externalsWeekly downloads growth on npm338,051downloads / week now7-day growth+42,433 weekly downloads+14.4%30-day growth+50,750 weekly downloads+17.7%90-day growth+97,715 weekly downloads+40.7%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
rollup-plugin-node-externals weekly downloads growth on npm: +14.4% over 7 days, +17.7% over 30 days, +40.7% over 90 days.

Ranking history

rollup-plugin-node-externals npm ranking history: currently #446 (by weekly downloads).rollup-plugin-node-externalsnpm ranking · by weekly downloads · Last 90 days#446current rank#425#430#435#440#445#450#455#460#465Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
rollup-plugin-node-externals npm ranking history: currently #446 (by weekly downloads).

Listing placement

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

Listing placement

Vite plugins300 listings · 15 pages · page 4, #7 (overall #67)
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 rollup-plugin-node-externals
Date (UTC)Weekly downloadsChange vs. previous
338,051-676
338,727+19.7K
319,061+26.9K
292,159-4.2K
296,400+2.2K
294,188-4.1K
298,249+2.6K
295,618-2.8K
298,407-13.9K
312,314-15.2K
327,472-2.5K
329,962+3.4K
326,568+6.8K
319,775—

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 Dec 6, 2026. See the methodology.