Skip to main content

tcb app build

Builds the locally-built items defined in the declarative config (cloudbaserc.json) — both hosting[] and app — to generate deployment output. Build only — no deployment, no dependency installation.

Usage​

tcb app build [options]

The command has no command-specific parameters; see Global Options for the common ones. It calls no cloud API and requires no login.

Used together with tcb deploy​

tcb app build # build app and hosting[] output locally
tcb deploy # upload the output and orchestrate remaining resources

Behavior​

  • Reads app and hosting[] in cloudbaserc.json and resolves a build command per item (priority: explicit buildCommand > framework preset > auto-detect from package.json dependencies)
  • Build order: app first, then hosting[] in declaration order
  • Runs the build command in each item's root directory
  • Does not run installCommand — install dependencies yourself beforehand (e.g. npm install); errors if package.json declares dependencies but node_modules is missing
  • Pure-static items (no buildCommand / framework: static) are skipped
  • Output is generated in each item's outputDir; when unset it is inferred from the build config (vite / vue → dist, react (CRA) → build, next → .next, angular → outputPath in angular.json)
  • When app.root and a hosting[].root point to the same directory, it is built once: app is built first, the skipped item reuses the command derived from app with a warning. If the two build commands differ, the one configured on hosting[] is ignored — configure separate root values to build them differently
  • Fail-fast: the first failing item aborts the run; remaining items are not built
  • When neither app nor hosting[] is configured, only an informational message is printed (no error)

Command comparison​

CommandBuildDeployDependencies
tcb app buildLocal build (app + hosting[])❌Not installed; install yourself
tcb deploy❌ No build (artifacts uploaded as-is)✅ All resources orchestratedNot handled
tcb app deployCloud build (app field)✅ Single app onlyInstalled in the cloud