Parcel is a blazing fast, zero-configuration web application bundler designed for simplicity and performance. The current stable version is 2.16.4, with the project maintaining a frequent release cadence for minor and patch updates. Key differentiators include its 'zero-config' approach, aiming to get developers up and running quickly without extensive setup. Under the hood, Parcel leverages Rust-based tooling (such as its JavaScript compiler and HTML/SVG transformers since v2.15.0) for significant performance improvements in bundling, minification, and tree-shaking. It supports a wide range of web assets out-of-the-box, including JavaScript (ES modules, CommonJS), TypeScript, React Server Components (since v2.14.0), CSS, HTML, SVG, images, and more, with automatic code splitting and differential bundling. Parcel also offers a robust plugin system for extensibility and a programmatic API for custom build integrations.
npm install parcelVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates programmatically building a project with Parcel using its JavaScript API, including setup for a worker farm and in-memory file system. It configures a production build for an HTML entry point and logs the build time and a snippet of the output HTML.
Upgrade Node.js to version 16.0.0 or higher (e.g., `nvm install 18` or `nvm use 18`). The `engines` field in `package.json` for Parcel specifies `>= 16.0.0`.
Upgrade your Linux distribution or ensure `glibc` version 2.26 or newer is installed. Consider using a Docker environment with a modern Linux base image if upgrading the host OS is not feasible.
For web applications, it's often best to remove the `main` field from `package.json` if it's not explicitly used for library exports, or configure your build targets explicitly in a `.parcelrc` or `package.json`'s `targets` field.
Update your CLI commands from `parcel build index.html --out-dir www` to `parcel build index.html --dist-dir www`.
Consider migrating minifier configurations to be compatible with `SWC` for optimal performance. You can still use a `.terserrc` if needed, but performance might be better with `SWC`'s native options.
To enable, add `"@parcel/resolver-default": { "packageExports": true }` to your project root `package.json`. Understand the implications of `"exports"` before enabling, as it strictly controls package boundaries.If experiencing CORS issues in development, consider using the `--no-cors` flag (e.g., `parcel serve --no-cors src/index.html`) or configuring appropriate headers in your application or proxy. Check the Parcel documentation for the exact default CORS policy.
Ensure `parcel` is installed locally: `npm install parcel --save-dev` or `yarn add parcel --dev`. If using global Parcel, ensure its path is in your system's PATH variable.
Try clearing Parcel's cache (`rm -rf .parcel-cache`) and your project's `dist` or output directory. If the issue persists, ensure your Node.js version is compatible and all dependencies are correctly installed. This can sometimes be related to specific transformer or packager plugins.
Verify that your `package.json` dependencies are correctly defined. For local dependencies, ensure paths are correct. For TypeScript `baseUrl` or `paths`, configure Parcel's resolver through `.parcelrc` or `package.json` aliases. Clear cache (`rm -rf .parcel-cache`) to ensure fresh resolution.
Ensure you are using a recent version of npm (>=7) or Yarn (>=1) that handles peer dependencies correctly. Try clearing your `node_modules` and `package-lock.json`/`yarn.lock` and reinstalling (`npm install` or `yarn install`). Verify that `@parcel/core` and `@parcel/fs` are correctly installed.
Double-check the path to your entry HTML file in the `parcel serve` command (e.g., `parcel serve src/index.html`). Ensure your `package.json`'s `main` field isn't inadvertently pointing to a non-existent file, or if you're using `package.json#main` for library export, explicitly specify the HTML entry in the CLI. Clear Parcel's cache (`rm -rf .parcel-cache`).
No dependency data recorded yet.