new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Bun · Bundler · all subjects

plugins

4 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Plugins in bunfig.toml for Bun.serve static routes

To configure plugins for `Bun.serve`, add a `plugins` array in the `[serve.static]` section of your `bunfig.toml`. Any JS file or module that exports a valid bundler plugin object (an object with a `name` and a `setup` field) can be placed in the plugins array. Bun lazily resolves and loads each plugin.

TailwindCSS plugin for Bun.serve

To use TailwindCSS with `Bun.serve`, install `tailwindcss` and `bun-plugin-tailwind`, then add `plugins = ["bun-plugin-tailwind"]` to the `[serve.static]` section in `bunfig.toml`. Import TailwindCSS in HTML as `<link rel="stylesheet" href="tailwindcss" />` or in CSS as `@import "tailwindcss";`.

Custom bundler plugin structure for Bun.serve

A valid bundler plugin is an object with required `name` field (string) and `setup` field (function). The setup function receives a build object and can use methods like `build.onLoad()` to handle custom file types. Plugin can be specified as a path string in `bunfig.toml` plugins array.

Plugins not yet supported in bun build CLI

Plugins work in `Bun.build()`'s JavaScript API when bundling fullstack routes from `Bun.serve()`, but are not yet supported in the `bun build` CLI. Plugins are configured in `bunfig.toml` so that the CLI can eventually know statically which plugins are in use.

Give your agent this brain