@zeropress/build
v0.5.2
Published
ZeroPress full-build CLI
Maintainers
Readme
@zeropress/build
ZeroPress full-build CLI.
This package is the public CLI wrapper around @zeropress/build-core.
Install
# Run directly with npx
npx @zeropress/build --help
# Or install globally
npm install -g @zeropress/build
zeropress-build --helpQuick Start
npx @zeropress/build ./theme --data ./preview-data.jsonUsage
zeropress-build <themeDir> --data <path> [--out <dir>]Arguments
<themeDir>: Theme directory to render
Options
--data <path>: Canonical preview-data v0.5 JSON file--out <dir>: Empty output directory, default./dist--help, -h: Show help--version, -v: Show version
Examples
zeropress-build ./my-theme --data ./preview-data.json
zeropress-build ./my-theme --data ./preview-data.json --out ./dist/siteInputs
Theme Directory
<themeDir>must be a local theme directory- The directory is validated with
@zeropress/theme-validator
Preview Data
--data <path>must point to canonical preview-data v0.5 JSON- The payload is validated by
@zeropress/build-coreagainst the canonical preview-data v0.5 contract - Optional
custom_htmlis treated as trusted site-level HTML and may inject markup before</head>and</body> - Only provide
custom_htmlfrom trusted admin/generator input; ZeroPress does not sanitize that HTML
Public Directory
- If the resolved public directory exists, its files are copied to the output root before generated ZeroPress files are written
- The public directory name itself is not included in the output path
- There is no
--public-diroption; setZEROPRESS_PUBLIC_DIRwhen a project needs a different public root ZEROPRESS_PUBLIC_DIRdefaults to./public/; relative values are resolved from the current working directory- Public files can be used for files such as
favicon.ico,ads.txt, third-party assets, source files, images, and PDFs - If a public file and a generated ZeroPress file use the same output path, the generated file wins
robots.txtis the exception: a root-level publicrobots.txtis treated as the site owner's robots policy and prevents ZeroPress fallbackrobots.txtgeneration- When public
robots.txtexists, ZeroPress copies it as-is and does not append aSitemapdirective. AddSitemap: https://example.com/sitemap.xmlmanually when needed. - Root-level public favicon files named
favicon.ico,favicon.svg,favicon.png, andapple-touch-icon.pngare auto-discovered and injected into generated HTML<head>output unless preview-data already definessite.favicon - Hidden entries,
node_modules,Thumbs.db,*.key,*.pem, and symlinks inside the public directory are ignored - The theme directory and output directory must not overlap with the resolved public directory
Output
- If
--outis omitted, output is written to./distrelative to the current working directory - The output directory must not already contain files before the command runs
- The output directory must be empty before public files are copied
- On success, the CLI prints generated file count, output directory, and elapsed time
- Full-build output includes the normal artifact set such as
index.html, post and page routes, hashed assets,sitemap.xml,feed.xml, and fallbackrobots.txt - If preview-data sets
site.indexing: false, the generated fallbackrobots.txtdisallows all agents. Custom crawler policies should be provided as publicrobots.txt.
Supported
- Full build only
- Local theme directory input
- Local preview-data JSON input
Not Supported
- Selective or patch build input
- Config files
- Remote preview-data URLs
- Deployment or publish integration
Requirements
- Node.js >= 18.18.0
- ESM only
Related
License
MIT
