{"id":21241,"library":"esbuild-plugin-entry-chunks","title":"esbuild-plugin-entry-chunks","description":"An esbuild plugin (v0.1.21) that composes entry points as static chunks without extracting common code, addressing the missing manual-chunks API. It allows one entry point to reuse another as a dependency without duplicating contents. Released as a PoC, with esbuild >=0.19.0 as a peer dependency. Primary alternative to esbuild's code-splitting with dynamic imports for static chunk composition.","status":"active","version":"0.1.21","language":"javascript","source_language":"en","source_url":"https://github.com/antongolub/misc","tags":["javascript","esbuild","plugin","chunks","entrypoints","typescript"],"install":[{"cmd":"npm install esbuild-plugin-entry-chunks","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-entry-chunks","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-entry-chunks","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: plugin requires esbuild >=0.19.0","package":"esbuild","optional":false}],"imports":[{"note":"Package ships TypeScript types and supports ESM; CommonJS require needs .entryChunksPlugin","wrong":"const entryChunksPlugin = require('esbuild-plugin-entry-chunks').entryChunksPlugin","symbol":"entryChunksPlugin","correct":"import { entryChunksPlugin } from 'esbuild-plugin-entry-chunks'"},{"note":"Default export available as named export 'entryChunksPlugin'","wrong":"import { default as entryChunksPlugin } from 'esbuild-plugin-entry-chunks'","symbol":"default","correct":"import entryChunksPlugin from 'esbuild-plugin-entry-chunks'"},{"note":"TypeScript type export; not available at runtime in CJS","wrong":"const EntryChunksPluginOptions = require('esbuild-plugin-entry-chunks').EntryChunksPluginOptions","symbol":"EntryChunksPluginOptions","correct":"import { EntryChunksPluginOptions } from 'esbuild-plugin-entry-chunks'"}],"quickstart":{"code":"import { build } from 'esbuild';\nimport { entryChunksPlugin } from 'esbuild-plugin-entry-chunks';\n\nconst plugin = entryChunksPlugin();\nconst config = {\n  entryPoints: ['a.ts', 'b.ts', 'c.ts'],\n  plugins: [plugin],\n  external: ['node:*'],\n  bundle: true,\n  minify: false,\n  sourcemap: false,\n  format: 'esm',\n  allowOverwrite: true,\n};\n\nawait build(config);","lang":"typescript","description":"Builds multiple entry points with static chunk composition using esbuild and esbuild-plugin-entry-chunks."},"warnings":[{"fix":"Ensure entry points are designed to be composed as dependencies (e.g., index.js vs cli.js). Use allowOverwrite: true to avoid errors.","message":"Plugin may cause output files to contain re-exported symbols from other entry points without extracting common code, leading to potential duplication across bundles.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Update esbuild to >=0.19.0.","message":"Requires esbuild >=0.19.0 due to plugin API changes; older esbuild versions may fail to load the plugin.","severity":"gotcha","affected_versions":"<0.19.0"},{"fix":"Evaluate stability and test thoroughly before using in production.","message":"Plugin is in PoC status; not recommended for production use without extensive testing.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Set bundle: true in esbuild config.","cause":"The plugin requires bundling to function; bundle option not set.","error":"Error: Plugin 'entry-chunks' must be used with 'bundle: true'"},{"fix":"Ensure entryPoints is an array with at least one file path.","cause":"Entry points array is empty or undefined.","error":"TypeError: Cannot read properties of undefined (reading 'length')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}