Skip to content

Configuration

The hop compiler is configured via a hop.toml file that marks the root of a hop project.

A minimal example:

toml
[target.typescript]
output = "frontend.ts"

Configuring the target

The hop.toml file should declare exactly one target. The target is the language the hop compiler should compile the hop sources to.

toml
[target.typescript]
# the path to the file generated by the hop compiler
output = "frontend.ts"
# the commands needed to compile and start a server (used by `hop dev`)
compile_and_run = ["node server.ts"]
toml
[target.go]
# the path to the file generated by the hop compiler
output = "frontend/frontend.go"
# the package name to use for the file generated by the hop compiler
package = "frontend"
# the commands needed to compile and start a server (used by `hop dev`)
compile_and_run = ["go build", "./server"]
toml
[target.python]
# the path to the file generated by the hop compiler
output = "frontend.py"
# the commands needed to compile and start a server (used by `hop dev`)
compile_and_run = ["python3 server.py"]