Registry / devops / rollup-plugin-deps-external

rollup-plugin-deps-external

JSON →
library0.2.1jsnpmunverified

Rollup plugin (v0.2.1) that automatically externalizes dependencies listed in package.json (dependencies, peerDependencies, and Node.js builtins). It simplifies the common task of excluding npm packages from the bundle, reducing bundle size and avoiding duplication. Most code is borrowed from rollup-plugin-auto-external but offers a slightly different API. Its defaults externalize builtins, dependencies, and peerDependencies. The last release was 0.2.0 with 0.2.1 as a patch. No known security issues. It integrates seamlessly with an existing Rollup external function.

npm install rollup-plugin-deps-external
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-DEPS
R
rollup-plugin-deps-external
devopsjavascriptv0.2.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

depsExternal
import depsExternal from 'rollup-plugin-deps-external'
const depsExternal = require('rollup-plugin-deps-external')
This package is ESM-only. CommonJS require will fail.
depsExternal
import { depsExternal } from 'rollup-plugin-deps-external'
import depsExternal from 'rollup-plugin-deps-external'
The module uses a default export, not a named export. Named import will not work.
depsExternal
import depsExternal from 'rollup-plugin-deps-external'
Default import is correct. No named exports available.

Minimal Rollup config that automatically externalizes all dependencies, peerDependencies, and Node builtins.

// rollup.config.js import depsExternal from 'rollup-plugin-deps-external'; export default { input: 'src/index.js', output: { dir: 'dist', format: 'es' }, plugins: [ depsExternal() ] };
Debug
Known issues
gotchaThe package is ESM-only and cannot be used with CommonJS require.
fix
Ensure your project is ESM ("type": "module" in package.json) or use a dynamic import.
affects: >=0.2.0
gotchaThe plugin uses a default export. Attempting named import will result in undefined.
fix
Use: import depsExternal from 'rollup-plugin-deps-external'
affects: >=0.2.0
gotchaOptions like builtins, dependencies, peerDependencies default to true. If you want to exclude some, you must explicitly set them to false.
fix
Pass options object, e.g., depsExternal({ peerDependencies: false }).
affects: >=0.2.0
gotchaThe packagePath defaults to process.cwd(). If your package.json is elsewhere, you must provide the correct path.
fix
Set packagePath: path.resolve('./path/to/package.json').
affects: >=0.2.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported.
Using CommonJS require to load an ESM-only package.
fix
Convert your config to ESM (use .mjs or "type": "module" in package.json) and use import.
TypeError: (0 , _rollupPluginDepsExternal.default) is not a function
Named import ({ depsExternal }) instead of default import.
fix
Change import statement to: import depsExternal from 'rollup-plugin-deps-external'
Could not resolve import: some-package (imported by src/index.js).
The package is not in package.json (e.g., a devDependency) but the plugin does not externalize it.
fix
Add the package to dependencies or peerDependencies, or use a different externalization strategy.
Upgrade
Version history
0.2.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
rollup-plugin-deps-external — npm install rollup-plugin-deps-external · libregistry