zntcbuild [root] # HTML rewrite + hashed assets → dist/
zntcpreview [outdir] # serve built files only
The default app layout is index.html, public/, src/main.ts(x), and .env*.
zntc build uses <script type="module" src> as bundle entries and rewrites CSS
url(), HTML asset URLs, and %ENV% tokens, and injects modulepreload links
for static split chunks. zntc dev uses the same HTML/env/public prepare step and
updates stylesheets for CSS edits without a full page reload.
in preview, fall back route-like 404 requests to index.html or the given file
--jsx*
JSX runtime (--jsx, --jsx-dev, --jsx-import-source, --jsx-factory, --jsx-fragment). When unset, the app root tsconfig.jsonjsx / jsxImportSource is used
zntc dev / zntc build resolve the JSX runtime in this order: CLI --jsx*
options → app root tsconfig.json (compilerOptions.jsx / jsxImportSource) →
default classic (React.createElement). Non-React apps such as preact/solid only
need "jsx": "react-jsx", "jsxImportSource": "preact" in tsconfig.json for both
dev and build to work.
If the app root contains postcss.config.{js,mjs,cjs,json} or .postcssrc*,
ZNTC automatically applies it to CSS. In zntc dev, original CSS files and PostCSS
dependency / dir-dependency messages are watched and CSS-only edits are sent
as stylesheet HMR updates. Tailwind v4 works via @tailwindcss/postcss. CSS
Modules (.module.css) in app mode are transformed into scoped class maps with
default exports and valid named exports. .scss / .sass files are compiled to
CSS before PostCSS when the optional sass dependency is installed.
This is a separate npx entry point that adds ZNTC scripts and config to an
existing React Native CLI project. Expo project creation/initialization is
currently out of scope.
Terminal window
npx@zntc/init
npx@zntc/init--help
Usage: zntc-init [react-native] [options]
Overlay ZNTC onto an existing React Native CLI project.
Options:
--root <dir> Project root (default: cwd)
--platform <ios|android> Default platform for the start script (default: ios)
--zntc-version <range> Version range for @zntc packages (default: latest)
--package-manager <pm> Install command hint: bun, npm, pnpm, or yarn
--no-metro-fallback Do not add Metro fallback scripts
--force Overwrite an existing zntc.config.ts
--dry-run Print planned changes without writing files
--help, -h Show this help message
Option
Description
--root <dir>
Project root. Defaults to the current directory
--platform <ios|android>
Default RN platform for the start script. Defaults to ios
--zntc-version <range>
Version range for @zntc/core and @zntc/react-native
@jsx / @jsxFrag only take effect when the effective runtime is classic (the automatic
runtime doesn’t use a factory). E.g. a project on React (jsx: react-jsx) can have one file
use preact by adding just /** @jsxImportSource preact */ — that file alone uses
preact/jsx-runtime.
Add a directory to watch roots (Metro watchFolders compatible, resolved to absolute path, repeatable)
--watch-include=<glob>
Whitelist glob for watchFolders scanning (repeatable)
--watch-exclude=<glob>
Exclude glob for watchFolders scanning (repeatable)
--dev
Enable dev mode (turn on dev-only behavior such as HMR runtime injection)
--serve [dir]
Static file server (default: .)
--port <n>
Server port
--host [addr]
Binding address
--strict-port
Fail instead of falling through to the next port when the requested port is busy
--certfile <path>
HTTPS certificate file (preview/serve)
--keyfile <path>
HTTPS private key file (preview/serve)
--open
Auto-open browser
--proxy /api=http://host:port
API proxy
Dev server external interfaces:/sse/events (SSE build events), /reset-cache (Control API), /mcp (Model Context Protocol — for LLM agents like Claude Code).
A subcommand that runs the requested phases N times and prints mean/median/p95/p99/stddev/min/max statistics. Use baseline save/compare for before/after optimization analysis.
Option
Description
--phase=<list>
Profile categories to measure as a CSV (required, e.g. parse,transform). all/none are not allowed
--iterations=<n>
Iteration count (default: 100, must be ≥ 1)
--warmup=<n>
Warmup runs before measured runs (default: 10)
--save=<path>
Save the run as a baseline JSON
--compare=<path>
Compare against an existing baseline JSON
--format=<fmt>
Output format — table|tree|json|csv (default: table)