Registry / devops / esbuild-plugin-external-package

esbuild-plugin-external-package

JSON →
library1.0.0jsnpmunverified

An esbuild plugin that automatically marks all dependencies from package.json as external during bundling. Version 1.0.0 is the initial stable release with no known release cadence. Unlike manual externals configuration, it scans dependencies, devDependencies, peerDependencies, and optionalDependencies, saving developers from maintaining a separate list. Ships TypeScript types. Lightweight with no runtime dependencies.

devopshttp-networking
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

The plugin is a default export, not a named export.

import externalPackage from 'esbuild-plugin-external-package'

The package is ESM-only; CommonJS require will fail unless using dynamic import.

import externalPackage from 'esbuild-plugin-external-package'

TypeScript types are included; use import type for type-only usage.

import type { ExternalPackagePlugin } from 'esbuild-plugin-external-package'

Builds a bundle where all package.json dependencies are marked external, leaving them as imports in the output.

import esbuild from 'esbuild'; import externalPackage from 'esbuild-plugin-external-package'; await esbuild.build({ entryPoints: ['./src/index.js'], bundle: true, outfile: './dist/index.js', plugins: [externalPackage], format: 'esm', target: 'es2020', });
Debug
Known footguns
gotchaPlugin uses ESBuild's analyzeMetafile? No, it only marks externals; does not modify bundle otherwise.
gotchaPlugin marks all dependencies as external, including devDependencies. This may cause runtime errors if devDependencies are needed at runtime.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
12 hits · last 30 days
gptbot
3
ahrefsbot
3
amazonbot
3
claudebot
3
Resources