Files
sweet/packages/plugin-tailwindcss-v3
Bartek IwańczukandClaude Opus 4.6 990aeb03f3 feat: support multiple staticDir entries (#3759)
## Summary
- `staticDir` now accepts `string | string[]` in both the **Vite
plugin** (`FreshViteConfig`) and the **Builder API** (`BuildOptions`)
- When multiple directories are specified, they are searched in order
and the first match wins
- **Vite plugin**: first dir maps to Vite's native `publicDir`; extra
dirs are served manually in the dev server and walked during production
builds
- **Builder API**: both `MemoryBuildCache` (dev) and `DiskBuildCache`
(prod) iterate over all directories
- Updated tailwind v3 plugin to use `config.root` instead of
`path.dirname(config.staticDir)`
- Docs updated: `static-files.md`, `vite.md`, `builder.md`

Closes #3105

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 07:49:32 +00:00
..
2025-09-09 18:52:36 +02:00

Tailwind CSS v3 plugin for Fresh

A Tailwind CSS v3 plugin to use in Fresh.

[info]: If you want to use latest tailwindcss use @fresh/plugin-tailwindcss instead.

Basic Usage

// dev.ts
import { Builder } from "fresh/dev";
import { tailwind } from "@fresh/plugin-tailwind-v3";

const builder = new Builder();
tailwind(builder);

if (Deno.args.includes("build")) {
  builder.build();
} else {
  builder.listen(() => import("./main.ts"));
}

Option Configuration

tailwind(builder, {
  // Exclude certain files from processing
  exclude: ["/admin/**", "*.temp.css"],

  // Force optimization (defaults to production mode)
  optimize: true,

  // Exclude base styles
  base: null,
});

To learn more about Fresh go to https://fresh.deno.dev/.