Lissome.GleamBuilder (Lissome v0.3.1)
View SourceWrapper around the Gleam build tool.
This module provides functionality to build Gleam source files to either JavaScript or Erlang targets using the Gleam CLI.
Summary
Functions
Builds Gleam source files to the specified target using the gleam build
command.
Functions
Builds Gleam source files to the specified target using the gleam build
command.
The target can be :javascript
, :erlang
, or a list of both.
Returns :ok
.
Options
:gleam_dir
- Path to the Gleam project. Defaults to the:gleam_dir
config inlissome
, or"assets/lustre_app"
if not set.:compile_package
- Iftrue
, usesgleam compile-package
instead ofgleam build
(default:false
).:watch
- Iftrue
, watches for file changes and rebuilds automatically. Requires theFileSystem
package to be available (default:false
).:load_beam_modules
- Iftrue
and the target is:erlang
, loads compiled modules automatically (default:true
).:erlang_outdir
- Custom output directory for Erlang beam files (only used with the:erlang
target). Defaults to"{build_path}/lib/_{gleam_app}/"
, wheregleam_app
is the name fromgleam.toml
.
Examples
iex> Lissome.GleamBuilder.build_gleam(:erlang)
iex> Lissome.GleamBuilder.build_gleam([:javascript, :erlang])
iex> Lissome.GleamBuilder.build_gleam(:javascript,
...> gleam_dir: "assets/my_gleam_app",
...> compile_package: true,
...> watch: true
...> )