Registry / devops / pkg-bundler

pkg-bundler

JSON →
library1.0.0-1jsnpmunverified

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.

npm install pkg-bundler
INSTALL
IMPORT
SIG · PKG-BUNDLER
P
pkg-bundler
devopsjavascriptv1.0.0-1
harness data pending
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.

pkg-bundler
✓ Install as dev dependency and use via CLI: `pkg-bundler src/index.js`
✗ No programmatic API; cannot be required or imported in code.
CLI-only; no JavaScript API exists.

Installs pkg-bundler, configures Babel, sets up package.json fields, creates a minimal source file, and builds dist bundles.

npm i -D pkg-bundler # .babelrc cat > .babelrc << 'EOF' { "presets": [ ["env", { "modules": false }], "react" ] } EOF # package.json (add fields) cat package.json | jq '. + {"main": "dist/index.cjs.js", "module": "dist/index.es.js", "scripts": {"prepare": "pkg-bundler src/index.js"}}' > package.json # src/index.js mkdir -p src echo 'export default function hello() { return "Hello World"; }' > src/index.js npm run prepare
pkg-bundler --version
Debug
Known issues
deprecatedPackage is effectively unmaintained; no updates since 2018.
fix
Consider migrating to a maintained bundler like microbundle or rollup with manual config.
affects: >=1.0.0
gotchaRequires specific file structure: .babelrc, main/module fields in package.json, and entry file must exist.
fix
Ensure all required fields and files are present before running.
affects: >=1.0.0
gotchaBabel preset 'env' must have { modules: false } to allow Rollup tree-shaking.
fix
Set { modules: false } in the preset configuration.
affects: >=1.0.0
gotchaCLI only accepts exactly one entry file; no glob support.
fix
Use a single entry point. For multiple entries, consider a different tool.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Could not find any entry point. Check the path.
CLI argument points to non-existent file or directory.
fix
Provide the correct path to your source entry file, e.g., pkg-bundler src/index.js
Error: Missing .babelrc or babel configuration.
No babel config found; pkg-bundler expects a .babelrc file.
fix
Create a .babelrc file with presets like [['env', {modules: false}], 'react'].
Error: 'main' field missing in package.json.
pkg-bundler checks for main and module fields in package.json to determine output paths.
fix
Add \"main\": \"dist/index.cjs.js\" and optionally \"module\": \"dist/index.es.js\" to package.json.
Upgrade
Version history
1.0.0-1latest on npm
Audit
Dependencies
rolluprequiredCore bundler used for creating dist bundles.
babel-corerequiredTranspilation via Babel, required if using .babelrc.
Agent activity
4 hits · last 30 days
node
4
Resources
pkg-bundler — npm install pkg-bundler · libregistry