{"id":26082,"library":"pkg-bundler","title":"pkg-bundler","description":"pkg-bundler is a zero-configuration Rollup bundler for npm packages, pre-configured with Babel, that automatically generates CommonJS and ES module bundles from a single entry point. Version 1.0.0-1 is the current stable release, with no active development observed. It differentiates from similar tools like microbundle or rollup-starter by enforcing a specific project structure (`.babelrc`, `main`/`module` fields) and providing a single CLI command with no configuration files required. However, its dependency on `rollup` and `babel` is opaque, and there is no support for TypeScript or modern bundling needs. Release cadence is low; the package is largely untended.","status":"maintenance","version":"1.0.0-1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install pkg-bundler","lang":"bash","label":"npm"},{"cmd":"yarn add pkg-bundler","lang":"bash","label":"yarn"},{"cmd":"pnpm add pkg-bundler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core bundler used for creating dist bundles.","package":"rollup","optional":false},{"reason":"Transpilation via Babel, required if using .babelrc.","package":"babel-core","optional":false}],"imports":[{"note":"CLI-only; no JavaScript API exists.","wrong":"No programmatic API; cannot be required or imported in code.","symbol":"pkg-bundler","correct":"Install as dev dependency and use via CLI: `pkg-bundler src/index.js`"}],"quickstart":{"code":"npm i -D pkg-bundler\n# .babelrc\ncat > .babelrc << 'EOF'\n{\n  \"presets\": [\n    [\"env\", { \"modules\": false }],\n    \"react\"\n  ]\n}\nEOF\n# package.json (add fields)\ncat package.json | jq '. + {\"main\": \"dist/index.cjs.js\", \"module\": \"dist/index.es.js\", \"scripts\": {\"prepare\": \"pkg-bundler src/index.js\"}}' > package.json\n# src/index.js\nmkdir -p src\necho 'export default function hello() { return \"Hello World\"; }' > src/index.js\nnpm run prepare\n","lang":"javascript","description":"Installs pkg-bundler, configures Babel, sets up package.json fields, creates a minimal source file, and builds dist bundles."},"warnings":[{"fix":"Consider migrating to a maintained bundler like microbundle or rollup with manual config.","message":"Package is effectively unmaintained; no updates since 2018.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Ensure all required fields and files are present before running.","message":"Requires specific file structure: .babelrc, main/module fields in package.json, and entry file must exist.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set { modules: false } in the preset configuration.","message":"Babel preset 'env' must have { modules: false } to allow Rollup tree-shaking.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use a single entry point. For multiple entries, consider a different tool.","message":"CLI only accepts exactly one entry file; no glob support.","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":"Provide the correct path to your source entry file, e.g., pkg-bundler src/index.js","cause":"CLI argument points to non-existent file or directory.","error":"Error: Could not find any entry point. Check the path."},{"fix":"Create a .babelrc file with presets like [['env', {modules: false}], 'react'].","cause":"No babel config found; pkg-bundler expects a .babelrc file.","error":"Error: Missing .babelrc or babel configuration."},{"fix":"Add \\\"main\\\": \\\"dist/index.cjs.js\\\" and optionally \\\"module\\\": \\\"dist/index.es.js\\\" to package.json.","cause":"pkg-bundler checks for main and module fields in package.json to determine output paths.","error":"Error: 'main' field missing in package.json."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}