LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

parcel

zero-configuration web application bundler

TLDR

Start development server
$ parcel [index.html]
copy
Build for production
$ parcel build [index.html]
copy
Specify output directory
$ parcel build [index.html] --dist-dir [dist]
copy
Watch mode without server
$ parcel watch [index.html]
copy
Specify port and open in browser
$ parcel [index.html] --port [3000] --open
copy
Build only a specific target defined in package.json
$ parcel build [index.html] --target [main]
copy
Build without minification or content hashing
$ parcel build [index.html] --no-optimize --no-content-hash
copy

SYNOPSIS

parcel [command] [options] entries...

DESCRIPTION

Parcel is a zero-configuration web application bundler. It supports JavaScript, CSS, HTML, images, and other assets out of the box with automatic transforms.Parcel uses worker processes for parallel builds and has a built-in dev server with Hot Module Replacement (HMR).

PARAMETERS

build

Production build and exit.
watch
Watch for changes and rebuild without starting a dev server.
serve
Start a development server with HMR (default command).
--dist-dir dir
Output directory (default value for distDir in package.json targets).
-p, --port port
Dev server port (also settable via PORT env var).
--host host
Dev server host (default: all interfaces).
--open
Automatically open entry in the default browser.
--lazy
Defer building files until requested in the browser.
--https
Enable HTTPS for the dev server.
--target target
Build only a specific target defined in package.json. May be specified multiple times.
--public-url url
Path prefix for absolute URLs.
--no-cache
Disable reading from the filesystem cache.
--cache-dir dir
Set cache directory (default: .parcel-cache).
--no-source-maps
Disable source maps.
--no-optimize
Disable optimizations such as minification.
--no-content-hash
Disable content hashing of output file names.
--log-level level
Set the log level (none, error, warn, info, verbose).
--config config
Specify Parcel config to use (default: @parcel/config-default).

CAVEATS

Parcel 2 has a different CLI than v1. Cache is stored in .parcel-cache. Build targets are configured in package.json, not via `--target node` as in v1.

HISTORY

Parcel was created by Devon Govett in 2017 as a zero-configuration alternative to webpack.

SEE ALSO

webpack(1), vite(1), esbuild(1), rollup(1), npm(1)

Copied to clipboard
Kai