GUIDES

Farm

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

examples/example-farm shows how to use @plumeria/unplugin in Farm.
The plugin compiles Plumeria styles into CSS, with HMR in development.

npx @plumeria/init detects Farm 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

farm.config.ts
import { defineConfig } from '@farmfe/core';
import plumeria from '@plumeria/unplugin';

export default defineConfig({
  plugins: [
    plumeria.farm({
      devEmitToDisk: true,
    }),
  ],
});

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