bun-plugin-gleam
v0.1.3
Published
Gleam plugin to bun runtime.
Maintainers
Readme
🧅 Gleam plugin to bun runtime.
Gleam language plugin to bun runtime.
This can uses with bunup.
Config
bun init my-app
cd my-appNow, create directory <roo>/bin and files:
dist.js: Bundlesrc/index.jsintodist/.serve.js: Serve on:3000directorydist/.
Follow file contents:
- Bun build:
import gleam from "bun-plugin-gleam";
Bun.build({
entry: ["src/index.js"],
out: "./dist",
plugins: [gleam({ force: true })]
});- Bun server:
required before run
bun run dist.js
import gleam from "bun-plugin-gleam";
Bun.serve({
port: 3000,
plugins: [gleam({ log: "debug", force: true })],
routes: {
"/": function() {
return new Response('Bun plugin gleam!');
},
}
});🌸 Options
import gleam from "bun-plugin-gleam";
Bun.build({
gleam({
// gleam root dir project
cwd: ".", // process.cwd() is default
// gleam binary path
bin: "gleam",
log: {
// "info" | "debug" | "trace" | "none"
level: "info",
// if put date and time
time: true,
},
build: {
// force build, default not exec gleam build
force: true,
// gleam build arg to break on warnings
warningsAsErrors: true,
// gleam build arg to show or not cmd output
noPrintProgress: false,
},
} as GleamPlugin);
});🧪 Demo
🌄 Roadmap
- [ ] Unit tests
- [ ] More docs
- [ ] GH workflow
- [ ] test
- [x] build
- [x] changelog & issue to doc
- [x] ~~auto publish~~ manual publish
- [x]
gleam publish
- [x]
- [ ] Pure gleam code
