Zero configuration web application bundler with blazing fast performance and comprehensive dev server
npx @tessl/cli install tessl/npm-parcel@2.15.0Parcel is a blazing fast, zero configuration web application bundler designed for modern web development. Built with performance in mind, it features a JavaScript compiler written in Rust for native performance, parallel processing using worker threads, and comprehensive caching to avoid rebuilding unchanged code.
npm install -g parcel or npm install --save-dev parcelParcel is a CLI-only tool that provides zero-configuration bundling through command-line interface:
# Start development server (default command)
parcel index.html
# Build for production
parcel build index.html
# Watch mode without dev server
parcel watch index.html
# Get help
parcel help# Install Parcel globally
npm install -g parcel
# Create a simple HTML file
echo '<html><body><script src="./app.js"></script></body></html>' > index.html
echo 'console.log("Hello Parcel!");' > app.js
# Start development server
parcel index.html
# ✨ Built in 123ms
# Server running at http://localhost:1234
# Build for production
parcel build index.html
# ✨ Built in 456ms
# dist/index.html 1.23 KB 123ms
# dist/app.js 2.45 KB 0msParcel operates as a command-line tool that orchestrates the build process through several key components:
serve, watch, build, help) that accept various optionsStart a development server with hot module replacement for rapid development workflow.
parcel serve [input...]
# or simply:
parcel [input...]
# Common options:
# --port <port> Set server port (default: 1234)
# --host <host> Set host to listen on
# --https Serve files over HTTPS
# --cert <path> Path to HTTPS certificate
# --key <path> Path to HTTPS private key
# --open [browser] Auto-open in browser
# --public-url <url> Path prefix for absolute URLs
# --lazy [includes] Build async bundles on demand, when requested in the browser
# --lazy-exclude <excludes> Can only be used with --lazy. Exclude from lazy building
# --watch-for-stdin Exit when stdin closesUsage Examples:
# Basic development server
parcel index.html
# Custom port and host
parcel serve src/index.html --port 3000 --host 0.0.0.0
# HTTPS development server
parcel index.html --https --cert ./cert.pem --key ./key.pem
# Auto-open in default browser
parcel index.html --open
# Lazy loading for large applications
parcel index.html --lazy "src/pages/**/*.js"
# Lazy loading with exclusions
parcel index.html --lazy --lazy-exclude "src/critical/**/*.js"Bundle application for production with optimizations enabled.
parcel build [input...]
# Common options:
# --no-optimize Disable minification
# --no-scope-hoist Disable scope-hoisting
# --public-url <url> Path prefix for absolute URLs
# --no-content-hash Disable content hashing
# --dist-dir <dir> Output directory
# --target [name] Build specific targetsUsage Examples:
# Basic production build
parcel build index.html
# Custom output directory
parcel build src/index.html --dist-dir build
# Disable optimizations for debugging
parcel build index.html --no-optimize --no-scope-hoist
# Build for specific targets
parcel build index.html --target web --target node
# Custom public URL for CDN deployment
parcel build index.html --public-url https://cdn.example.com/Monitor files for changes and rebuild automatically without development server.
parcel watch [input...]
# Common options:
# --public-url <url> Path prefix for absolute URLs
# --no-content-hash Disable content hashing
# --watch-for-stdin Exit when stdin closes
# HMR options (same as serve command):
# --no-hmr Disable hot module replacement
# --hmr-port <port> Hot module replacement port
# --hmr-host <host> Hot module replacement hostUsage Examples:
# Basic watch mode
parcel watch index.html
# Watch with custom settings
parcel watch src/index.html --no-content-hash --public-url /assets/Get help information for commands and options.
parcel help [command]
# Examples:
parcel help # General help
parcel help serve # Help for serve command
parcel help build # Help for build commandThese options are available across all commands:
# Cache control
--no-cache # Disable filesystem cache
--cache-dir <path> # Set cache directory (default: .parcel-cache)
# Performance monitoring
--profile # Enable sampling build profiling
--trace # Enable build tracing
--detailed-report [count] # Print asset timings and sizes# Watch configuration
--watch-dir <path> # Set root watch directory (defaults to nearest lockfile or source control dir)
--watch-ignore [paths] # Directories to ignore (comma-separated, defaults to '.git,.hg')
--watch-backend <name> # Set watcher backend
# Choices: brute-force, watchman, fs-events, inotify, windows# Configuration
--config <path> # Specify config path or package name
--no-source-maps # Disable sourcemaps
--target [name] # Build specific targets (can be used multiple times)
--no-autoinstall # Disable automatic dependency installation# HMR configuration (serve/watch commands)
--no-hmr # Disable hot module replacement
--hmr-port <port> # Hot module replacement port
--hmr-host <host> # Hot module replacement host# Logging
--log-level <level> # Set log level
# Choices: none, error, warn, info, verbose
# Reporting
--reporter <name> # Additional reporters (can be used multiple times)# Feature flags
--feature-flag <name=value> # Set feature flag values
# Format: --feature-flag name=true
# Available flags: exampleFeature, useWatchmanWatcher# Version
-V, --version # Output version numberParcel automatically discovers entry points based on file extensions and content:
index.html, src/index.htmlindex.js, main.js, app.js, src/index.tsmain, module, or browser fieldsparcel build src/*.html for multiple pagesParcel supports multiple build targets:
While zero-config by default, Parcel supports optional configuration:
.parcelrc: Main configuration filepackage.json: Browserslist, source fieldstsconfig.json: TypeScript configurationpostcss.config.js: PostCSS configurationParcel provides detailed error messages and diagnostics:
While Parcel is running, these keyboard shortcuts are available:
# Keyboard shortcuts during runtime
Ctrl+C # Graceful exit
Ctrl+E # Toggle profiling
Ctrl+Y # Take heap snapshotParcel recognizes several environment variables:
NODE_ENV: Automatically set based on command (development for serve/watch, production for build)PORT: Default port for development server (defaults to 1234)HMR_PORT: Default HMR portHMR_HOST: Default HMR hostCI: When detected, disables autoinstall for build commandPARCEL_BUILD_ENV: Internal build environment controlParcel handles ports intelligently:
$PORT environment variable$HMR_PORT)Parcel automatically sets the build mode:
parcel build command (enables optimizations)parcel serve and parcel watch commands (enables debugging features)