Registry /
devops / esbuild-plugin-noexternal
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.
default
✓ import externalizeAllPackagesExcept from 'esbuild-plugin-noexternal'
✗ const externalizeAllPackagesExcept = require('esbuild-plugin-noexternal')
Package is ESM-only; CommonJS require is not supported.
externalizeAllPackagesExcept (named)
✓ import { externalizeAllPackagesExcept } from 'esbuild-plugin-noexternal'
✗ import externalizeAllPackagesExcept from 'esbuild-plugin-noexternal'
Both default and named exports exist; the named export is an alias for the default export.
Plugin type
✓ import type { Plugin } from 'esbuild'
✗ import { Plugin } from 'esbuild-plugin-noexternal'
The package does not export plugin types; use esbuild's own Plugin type if needed.
Builds a bundle that includes only 'nanoid' and 'slash'; all other npm packages are treated as external.
import esbuild from 'esbuild';
import externalizeAllPackagesExcept from 'esbuild-plugin-noexternal';
await esbuild.build({
entryPoints: ['src/index.ts'],
bundle: true,
outfile: 'out.js',
plugins: [externalizeAllPackagesExcept(['nanoid', 'slash'])],
});
Debug
Known issues
gotchaPlugin uses 'onResolve' to mark packages as external; does not support custom filter or namespace.fixIf you need more control, consider writing a custom 'onResolve' plugin or using esbuild-plugin-external-global-packages.
affects: >=0.1.0
gotchaAll external packages must be installed; the plugin does not validate package existence.fixEnsure all dependencies not in the listed array are installed; otherwise imports will fail at runtime.
affects: >=0.1.0
deprecatedNo known deprecations.
Errors
Common errors & fixes
Cannot find module 'esbuild-plugin-noexternal'
Package not installed.
fixnpm install -D esbuild-plugin-noexternal
The requested module 'esbuild-plugin-noexternal' does not provide an export named 'default'
Using named import instead of default import incorrectly.
fixUse: import externalizeAllPackagesExcept from 'esbuild-plugin-noexternal'
Audit
Dependencies
esbuildrequiredpeer dependency; plugin is designed for use with esbuild's plugin system