Compile Gleam to JavaScript as part of the build step

I am trying to use Gleam as the source language for my front end project.

Gleam is a fast, friendly, and functional language that recently announced support for compilation to JavaScript.

Gleam has built binaries that are used for compilation.

gleam compile-package --src src --out build/gen --name my_app --target javascript

What is the best way to install that binary in the netlify build environment?
My thoughts are

  1. commit the binary into my source repo (I’d rather not do this)
  2. fetch it using curl, if so is there a way to cache this?

The current way is to commit binary to your repo.

When using anything custom or one of the binaries not included in Netlify’s build image, you have to commit the binary to your repo. There’s a chance that you could write a script to download the binary using curl, however this is not tested. If you do get it to work this or some other way, do let us know.

1 Like