Parcel (prcl)
raw JSON → 0.4.0 verified Sat Apr 25 auth: no javascript
Parcel is an ultra-fast JavaScript bundler designed for development speed, v0.4.0, with no release cadence (sporadic). It avoids parsing JS fully, working mostly by concatenation with a few simple rules (no dynamic requires, no non-constant module names). Key differentiator: sub-10ms rebuilds, faster than Browserify or FuseBox by an order of magnitude, but lacks advanced features like tree-shaking. Ideal for rapid iteration during development, not production builds. ESM-only; CommonJS require() is used but only with static strings.
Common errors
error Error: Cannot find module 'prcl' ↓
cause Trying to import prcl programmatically, but it has no programmatic API.
fix
Use as CLI only:
npx prcl index.js bundle.js error Error: require is not defined ↓
cause Running bundled output in the browser without a module system.
fix
Parcel outputs CommonJS; in browser, load with a script tag but ensure require is defined (e.g., bundle with a shim). Or use for Node only.
error TypeError: Cannot read properties of undefined (reading 'map') ↓
cause Using a relative path require that doesn't resolve correctly; Parcel does not resolve Node modules from node_modules as robustly as other bundlers.
fix
Ensure all dependencies are installed and required with exact paths. For npm packages, use 'prcl' with explicit node_modules paths if needed.
Warnings
gotcha Package name is 'prcl' on npm, not 'parcel' (which is a different package). ↓
fix Install with `npm install -g prcl` or `npx prcl`. Do not confuse with `parcel`.
deprecated This package is extremely outdated (last release 2017?) and no longer maintained. Use at your own risk. ↓
fix Consider modern alternatives like esbuild or Vite for fast bundling.
gotcha Dynamic require() expressions are not supported; only static string literals. ↓
fix Replace dynamic requires with static ones or use a different bundler.
gotcha Variable or property named 'require' is forbidden. ↓
fix Rename any variable or property to avoid shadowing 'require'.
gotcha No tree-shaking; bundles entire modules even if you only use a small part. ↓
fix Use a production bundler like Webpack or Rollup for optimized output.
gotcha No built-in support for TypeScript, JSX, or CSS imports. ↓
fix Add transforms manually (e.g., tsc --module commonjs) before bundling.
gotcha Watch mode (-w) may have file descriptor leaks on some systems. ↓
fix Restart the process periodically or avoid long-running watch sessions.
Install
npm install prcl yarn add prcl pnpm add prcl Imports
- default (CLI) wrong
npx parcel index.js bundle.jscorrectnpx prcl index.js bundle.js - N/A (no programmatic API) wrong
import prcl from 'prcl'correctconst prcl = require('prcl') // not exposed - CLI watch mode wrong
prcl --watch index.js bundle.jscorrectprcl -w index.js bundle.js
Quickstart
// math.js
exports.square = x => x * x
// index.js
const itt = require('itt')
const math = require('./math')
console.log(itt.range(10).map(math.square).join(' '))
// terminal
// npm install -g prcl
// prcl index.js >bundle.js
// node bundle.js