pocka/rollup-plugin-gleam(opens in a new tab)
Language: TypeScript
Rollup / Vite plugin for Gleam language
- stars
- 6
- watchers
- 1
- forks
- 1
- open issues
- 0
- Last updated
- 11/11/2025
Language: TypeScript
Rollup / Vite plugin for Gleam language
A Rollup plugin that add supports for Gleam language. Also compatible with Vite.
@pocka/rollup-plugin-gleamThis plugin requires Rollup >= v1.12.0 and a working Gleam executable (gleam).
Import the plugin in your rollup.config.js or vite.config.js:
import { gleam } from "@pocka/rollup-plugin-gleam"; export default { // ... plugins: [gleam()], };
Then you can import .gleam files:
// hello.gleam pub fn hello(name: String) -> String { "Hello, " <> name }
import { hello } from "./hello.gleam"; console.log(hello("World"));
URL or String"./gleam.toml"File path or file URL to gleam.toml.
If the value is relative path string, this plugin resolves the path from current working directory.
gleam({ gleamToml: new URL("./gleam.toml", import.meta.url), });
"gleam"Binary name or path to Gleam executable file. This plugin builds Gleam file using this value.
gleam({ bin: "/path/to/gleam", }); // > /path/to/gleam build --target javascript
falseThis option activates --warning-as-errors compiler flag.
If this option is enabled, warning made by Gleam compiler will be treated as a build error.
gleam({ buildOptions: { warningAsErrors: true, }, });
// This won't compile with the flag on, due to an unused variable warning. pub fn hello(name: String) -> String { "Hello World!" }
This software is licensed under Apache License Version 2.0.
This project adheres to REUSE Specification.
Every checked-in file has copyright and license information inside a comment header, adjacent *.license file, or REUSE.toml file.