Skip to content

Navigation Menu

Sign in
Sign up

Repository files navigation

esgleam

An esbuild plugin for gleam ✨

Gleam is a beautiful little language that compiles to JS and to Erlang. Esbuild is an excellent little js bundler. It's a great match! 🌸

Usage

# install
npm i --save-dev esgleam esbuild
# or
yarn add --dev esgleam esbuild

in conjunction with esbuild

more info @ https://esbuild.github.io/plugins/#using-plugins

// add to your esbuild config file
import esbuild from "esbuild"
import esgleam from "esgleam"
esbuild.build({
 entryPoints: ['./src/main.gleam'],
 bundle: true,
 outfile: 'out.js',
 plugins: [esgleam.esgleam({ main_function: "main", project_root: "." })],
}).catch(() => process.exit(1))

Options

export interface EsGleamOptions {
 // path to the root of the gleam project
 // default: "."
 project_root?: string;
 // if defined the output file will call this function with no args
 // useful for bundled js files
 main_function?: string;
 // other flags to be passed to the gleam compiler
 compile_args?: string[];
}

About

esbuild plugin for gleam 🌸

Topics

Resources

Stars

20 stars

Watchers

2 watching

Forks

Used by

Contributors

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /