Usage
- 1
Install the Plugin
pnpm add -D @yummacss/vite - 2
Register It
Add the plugin to your Vite configuration.
vite.config.tsimport { defineConfig } from "vite";import yummacss from "@yummacss/vite";
export default defineConfig({ plugins: [yummacss()],}); - 3
Add the Marker
Put
@yummacss;in your CSS entry file. The plugin replaces it with the generated CSS.src/styles.css@yummacss;Installation walks through the whole setup, including the config file.
Options
| Option | Type | Default | Description |
|---|---|---|---|
config | Config | Inline configuration. When provided, no config file is read. | |
configPath | string | yumma.config.mjs | Path to the config file. |
Passing config inline is useful when the configuration has to be computed, such as a monorepo package that derives its source globs from its own location:
vite.config.ts
import { defineConfig } from "vite";
import yummacss from "@yummacss/vite";
export default defineConfig({
plugins: [
yummacss({
config: { source: ["./src/**/*.tsx"] },
}),
],
});