Skip to content

Building

Use chant build to synthesize your TypeScript resource definitions into deployment-ready output.

Terminal window
chant build # Build from current directory
chant build ./infra # Build from a specific path
chant build -o stack.json # Output to file
chant build --format yaml # YAML output
chant build --watch # Re-run on file changes

See the build CLI reference for full flag documentation.

The build command:

  1. Discovers all .ts files in the specified path
  2. Imports modules and collects declarable entities
  3. Resolves attribute references and dependencies
  4. Builds dependency graph and performs topological sort
  5. Serializes to the lexicon-specific format
  6. Outputs result to stdout or file

When your project uses child projects (e.g. nested stacks), the build may produce multiple output files. For example, the AWS lexicon’s nestedStack() generates a parent template plus one child template per child project:

Terminal window
chant build -o template.json
# Produces:
# template.json — parent template
# network.template.json — child template (one per nestedStack)

All generated files are written alongside the primary output file. See Multi-Stack Output for details.

chant does not include a deployment engine. Use your target platform’s tools to deploy the generated output. See your lexicon’s documentation for provider-specific deployment examples.