Skip to content

Configuration

Targo projects are usually controlled by a small set of configuration files.

Main Files

FileRole
targo.jsonTargo compiler and binder configuration
tsconfig.jsonTypeScript-facing editor and project configuration
tsconfig.targo.jsongenerated declaration include config
go.modGo module identity and dependencies
types/**optional local declaration output for project-local Go code

targo.json

Use targo.json for Targo-specific behavior such as:

  • compiler output settings
  • binder-related options
  • project-wide Targo semantics and generation choices

If behavior changes at compile time even though TypeScript still looks valid, inspect targo.json.

tsconfig.json

Use tsconfig.json for:

  • editor and TS project settings
  • declaration inclusion model
  • no-emit type-checking behavior in the source tree

Do not assume tsconfig.json alone defines Targo compile behavior.

tsconfig.targo.json

  • generated by the toolchain
  • usually gitignored
  • reflects current declaration state, including global cache entries
  • should not be hand-edited

Optional Generated Trees

  • types/** may be generated for local Go directory bindings
  • vendored .targo/** may exist in compatibility or explicit --vendor workflows
  • should not be hand-edited
  • may need regeneration after dependency or config changes

Practical Rules

  • Source of truth is src/, not generated artifacts.
  • If config-related errors look misleading, rerun targo init before deeper debugging.
  • Treat targo.json and go.mod changes as potentially declaration-affecting.