Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/PROMETHIA-27/mote
https://github.com/PROMETHIA-27/mote
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/PROMETHIA-27/mote
- Owner: PROMETHIA-27
- Created: 2023-06-19T14:56:14.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-06-19T20:21:05.000Z (over 1 year ago)
- Last Synced: 2024-04-23T23:55:35.945Z (7 months ago)
- Language: Gleam
- Size: 14.6 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mote
A gleam executable bundler.
# Installation:
- Download a release of `mote`, and make it accessible for your project (either in the project directory, on your path, etc)
- Install [`warp-packer`](https://github.com/dgiagio/warp/tree/master) and make it accessible as well (recommended to put it on the path)
- Create a folder somewhere containing at least one erlang runtime, and add it to the environment variable `GLEAM_MOTE_RUNTIMES`
- Example runtime folder:
```
erlang_runtimes/
- windows_x64/
- bin/
- erts-14.0.1/
- ...
- linux_x64/
- bin/
- erts-14.0.1/
- ...
```
- Example envvar:
- `SET GLEAM_MOTE_RUNTIMES=C:\users\madelline\erlang_runtimes`
# Usage:
In your project's root directory, run `mote --runtime ` to pack your project with the given runtime.
Add the `--target` flag (options `windows-x64`, `macos-x64`, `linux-x64`) to pack for a target other than your current environment.In your `gleam.toml` file, you can add extra options to strip out unnecessary components (this can net you a 90+% reduction in executable size! Primarily via the lib whitelist)
This example setup will reduce your setup to more or less the minimal possible components:
```toml
[mote]
bin_whitelist = [
"erl.exe",
"launch.escript",
"launch.exe",
"no_dot_erlang.boot",
]
erts_bin_whitelist = [
"beam.smp.dll",
"erlexec.dll",
]
lib_whitelist = [
"compiler",
"kernel",
"stdlib",
]
```This does remove many components of the erlang runtime that might be necessary depending on what you were doing. For example, the lib whitelist is stripping out libraries such as `xmerl` that are used for xml handling.
The erts bin whitelist is removing components such as `heart` which are presumably necessary for the heartbeat functionality of the erlang runtime.
However, for "normal" apps, many of these components should be unnecessary.