{"id":25378,"library":"esbuild-plugin-noexternal","title":"esbuild-plugin-noexternal","description":"An esbuild plugin that externalizes all npm packages except those explicitly allowed. v0.1.6, stable but minimal release cadence. The key differentiator is simplicity: it inverts esbuild's default externalization logic by marking everything external except a user-defined list, similar to Vite's `noExternal` option. Best for build scenarios like SSR or bundling where most dependencies should be excluded. Ships TypeScript types.","status":"active","version":"0.1.6","language":"javascript","source_language":"en","source_url":"https://github.com/mayank99/esbuild-plugin-noexternal","tags":["javascript","esbuild","plugin","typescript"],"install":[{"cmd":"npm install esbuild-plugin-noexternal","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-noexternal","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-noexternal","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; plugin is designed for use with esbuild's plugin system","package":"esbuild","optional":false}],"imports":[{"note":"Package is ESM-only; CommonJS require is not supported.","wrong":"const externalizeAllPackagesExcept = require('esbuild-plugin-noexternal')","symbol":"default","correct":"import externalizeAllPackagesExcept from 'esbuild-plugin-noexternal'"},{"note":"Both default and named exports exist; the named export is an alias for the default export.","wrong":"import externalizeAllPackagesExcept from 'esbuild-plugin-noexternal'","symbol":"externalizeAllPackagesExcept (named)","correct":"import { externalizeAllPackagesExcept } from 'esbuild-plugin-noexternal'"},{"note":"The package does not export plugin types; use esbuild's own Plugin type if needed.","wrong":"import { Plugin } from 'esbuild-plugin-noexternal'","symbol":"Plugin type","correct":"import type { Plugin } from 'esbuild'"}],"quickstart":{"code":"import esbuild from 'esbuild';\nimport externalizeAllPackagesExcept from 'esbuild-plugin-noexternal';\n\nawait esbuild.build({\n  entryPoints: ['src/index.ts'],\n  bundle: true,\n  outfile: 'out.js',\n  plugins: [externalizeAllPackagesExcept(['nanoid', 'slash'])],\n});","lang":"typescript","description":"Builds a bundle that includes only 'nanoid' and 'slash'; all other npm packages are treated as external."},"warnings":[{"fix":"If you need more control, consider writing a custom 'onResolve' plugin or using esbuild-plugin-external-global-packages.","message":"Plugin uses 'onResolve' to mark packages as external; does not support custom filter or namespace.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Ensure all dependencies not in the listed array are installed; otherwise imports will fail at runtime.","message":"All external packages must be installed; the plugin does not validate package existence.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"","message":"No known deprecations.","severity":"deprecated","affected_versions":""}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install -D esbuild-plugin-noexternal","cause":"Package not installed.","error":"Cannot find module 'esbuild-plugin-noexternal'"},{"fix":"Use: import externalizeAllPackagesExcept from 'esbuild-plugin-noexternal'","cause":"Using named import instead of default import incorrectly.","error":"The requested module 'esbuild-plugin-noexternal' does not provide an export named 'default'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}