{"id":25338,"library":"esbuild-plugin-external-package","title":"esbuild-plugin-external-package","description":"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.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/yamitsushi/esbuild-plugin-external-package","tags":["javascript","ESBuild","esbuild","plugin","typescript"],"install":[{"cmd":"npm install esbuild-plugin-external-package","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-external-package","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-external-package","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The plugin is a default export, not a named export.","wrong":"import { externalPackage } from 'esbuild-plugin-external-package'","symbol":"default","correct":"import externalPackage from 'esbuild-plugin-external-package'"},{"note":"The package is ESM-only; CommonJS require will fail unless using dynamic import.","wrong":"const externalPackage = require('esbuild-plugin-external-package')","symbol":"externalPackage","correct":"import externalPackage from 'esbuild-plugin-external-package'"},{"note":"TypeScript types are included; use import type for type-only usage.","symbol":"type definition","correct":"import type { ExternalPackagePlugin } from 'esbuild-plugin-external-package'"}],"quickstart":{"code":"import esbuild from 'esbuild';\nimport externalPackage from 'esbuild-plugin-external-package';\n\nawait esbuild.build({\n  entryPoints: ['./src/index.js'],\n  bundle: true,\n  outfile: './dist/index.js',\n  plugins: [externalPackage],\n  format: 'esm',\n  target: 'es2020',\n});","lang":"typescript","description":"Builds a bundle where all package.json dependencies are marked external, leaving them as imports in the output."},"warnings":[{"fix":"If you need externals but also metafile analysis, combine with other plugins.","message":"Plugin uses ESBuild's analyzeMetafile? No, it only marks externals; does not modify bundle otherwise.","severity":"gotcha","affected_versions":"1.0.0"},{"fix":"Update plugin configuration if available, or filter dependencies manually.","message":"Plugin marks all dependencies as external, including devDependencies. This may cause runtime errors if devDependencies are needed at runtime.","severity":"gotcha","affected_versions":"1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use import or dynamic import() instead of require().","cause":"Using CommonJS require() on an ESM-only package.","error":"Error: [plugin: external-package] Must use import to load ES Module: /path/to/esbuild-plugin-external-package"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}