Skip to content

Options Matrix

ZNTC exposes options through four public surfaces. Use this matrix to catch documentation and implementation drift when adding or checking a feature.

  • CLI: the zntc command and packages/core/bin/cli-flags.mjs.
  • JS API: @zntc/core transpile() / build() / watch() types.
  • Config: user config loaded from zntc.config.* / zntc.workspace.*.
  • Schema: transpile-only JSON schema. Bundler-only fields are intentionally excluded.
Feature groupCLIJS APIConfigSchemaNotes
I/O (outfile, outdir, outbase, outExtension)outdir and naming patterns are bundler output options
Module format (format, platform)react-native also enables the RN preset
ES/runtime targets (target, browserslist)there’s also a --browserslist CLI flag (alternative to --target); when set it takes precedence over target
Runtime polyfills (runtimePolyfills, runtimeTarget, coreJs)core-js injection from graph usage
JSX / TS / Flow transformsselected tsconfig fields are used as fallback values
define/drop/inject/purepartialdropLabels, pure, and inject are mostly bundler-facing
Granular minifyproperty mangle options are intentionally unsupported
Source maps (sourcemapMode, sourcesContent, sourceRoot)RN sourcemap output flags are covered by the RN CLI docs
Resolver (external, alias, fallback, conditions)array/RegExp alias requires async build() / watch()
Loader / asset names / public pathseparate from app-mode HTML/CSS asset rewriting
Code splitting / preserve modulessplitting requires outdir
manualChunksfunction form requires zntc.config.{ts,js} or JS API
metafile / analyzepartialmetafile is config-capable; analyze is CLI/API-oriented. Inspect meta.json at /analyze/
Watch / serve / dev serverwatch() exposes rich events and lazy sourcemap APIs
App builder (dev, build, preview)partialHTML/env/public/CSS pipeline requires @zntc/web
Plugin hooks✅ (--plugin)JS plugins are not supported by buildSync()
Diagnostics / profile / debugpartialprofile is exposed through CLI and configureProfile()
Workspacezntc.workspace.* manages multiple entries

buildSync() cannot run JS plugins, array/RegExp aliases, or host-RegExp hooks because the native worker would need to wait on JS callbacks. Use async build() or watch() for those features.

When adding a new option:

  1. Add the field to the public @zntc/core type when it is part of the JS API.
  2. If the feature should be available from CLI, update cli-flags.mjs, zntc.mjs, help text, and parse tests.
  3. If config should accept it, update KNOWN_CONFIG_KEYS, typo suggestions, and config merge tests.
  4. If it is transpile-only, regenerate the schema with zig build schema and update reference/options.
  5. If only some surfaces support it, document the limitation here and in the relevant guide.