GUIDES

Bun

Add Plumeria to a Bun project, with one command or by hand.

examples/example-bun shows how to use @plumeria/unplugin in Bun.
The plugin compiles Plumeria styles into the CSS asset Bun produces.

npx @plumeria/init detects Bun and writes this setup for you; see @plumeria/init. The rest of this page is the same setup by hand.

Installation

Terminal
pnpm i -D @plumeria/unplugin

Usage

scripts/build.js
import plumeria from '@plumeria/unplugin';

await Bun.build({
  entrypoints: ['./src/index.tsx'],
  outdir: './dist',
  plugins: [plumeria.bun()],
});

plumeria.d.ts

@plumeria/core ships no prop declaration of its own, so name the styling prop your project compiles with.

For the default name (classStyle), reference the declaration that ships with the package, in src/ when the project has one or at the application root otherwise:

plumeria.d.ts
/// <reference types="@plumeria/core/class-style" />

If you set a custom styleProp (such as 'sx'), declare that name instead, and keep it the same as the one passed to the plugin; see Declaring the styling prop.

Edit on GitHub

On this page