An esbuild plugin that provides fine-grained control over external dependencies, ensuring that when a package like 'rxjs' is marked external, its subpath imports (e.g., 'rxjs/operators') are not also externalized unless explicitly specified. This prevents surprises in microfrontend or library builds where partial bundling of submodules is desired. Current stable version is 1.4.0, released as part of the piral-cli-esbuild ecosystem. Actively maintained with a strong focus on correct external handling for monorepos and shared dependency scenarios. Ships TypeScript types. Requires Node >=16.0.
npm install esbuild-externals-pluginNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to use externalsPlugin with esbuild to externalize 'lodash' and 'react' while keeping subpath imports like 'lodash/fp' bundled.
Update Node.js to version >=20.18.1.
Either add each subpath individually to the externals list or rely on the default esbuild externals behavior.
Update esbuild to version >=0.18.
Use destructured require: const { externalsPlugin } = require('esbuild-externals-plugin').Use import { externalsPlugin } from 'esbuild-externals-plugin' or const { externalsPlugin } = require('esbuild-externals-plugin').Call externalsPlugin with an array: externalsPlugin(['lodash', 'react']).
Add 'rxjs/operators' explicitly to the externals array if you need it external.
No dependency data recorded yet.