Everything below is also available as packall --help, and as controls in the
browser runner — all three are read from the same declaration, so they cannot
describe different tools.
Read specs from a file: a package.json (bundles its dependencies), a lockfile (bundles the versions it pins), or one spec per line with # and // comments. Detected by content, not extension
--prod
Requires --file
With --file <package.json>, skip devDependencies (default: false)
--lockfile MODE
With --file <package.json>: detect finds a sibling lockfile (default) · off never does · npm, pnpm or bun requires that one · or pass a path (default: detect)
Where bundles are written and what shape they take. --layout is the one most runs
care about; see Output layouts.
--out, -o DIR
Directory to write bundles into (default: the current directory) (default: .)
--layout
per-spec: one tarball per package (default) · single: one deduplicated tarball · dir: unpacked tree · flat: one directory of tarballs, no nesting (per-spec · single · dir · flat)
--layout-threshold N
Switch to --layout single above N archives, or at 2x duplication, without asking. Omit to be asked instead at 20; pass 0 to neither ask nor switch
--archive-name NAME
Requires --layout single
Base name for the archive in --layout single
--force
Replace any existing output file. --no-force refuses instead. Omit to be asked per file
--force-spec SPEC
Always replace these specs, whatever --force says about the rest, e.g. --force-spec tsdown esbuild@0.21.5
--print-absolute-path
Report full paths instead of ones relative to the current directory (default: false)
--json
Emit a machine-readable summary on stdout (default: false)
Which versions and which platforms end up in the closure. The defaults are chosen so
the bundle installs on a machine that is not yours — see
Versions and platforms for why.
--all-versions
Bundle every published version matching a range, not just the best match (default: false)
--max-versions N
Requires --all-versions true
With --all-versions, keep at most the N newest matching versions
--include-prerelease
Let prereleases satisfy ranges (default: false)
--optional
Follow optionalDependencies. On by default — this is where per-platform native binaries live (default: true)
0 on success, including a dry run that wrote nothing. 1 on any failure — a bad flag,
an unreachable registry, a package that does not exist, an integrity mismatch, or a
refused overwrite.