MCPcopy
hub / github.com/freshframework/fresh / tailwind

Function tailwind

packages/plugin-tailwindcss/src/mod.ts:9–31  ·  view source on GitHub ↗
(
  builder: Builder,
  options: TailwindPluginOptions = {},
)

Source from the content-addressed store, hash-verified

7export type { TailwindPluginOptions } from "./types.ts";
8
9export function tailwind(
10 builder: Builder,
11 options: TailwindPluginOptions = {},
12): void {
13 const { exclude, ...tailwindOptions } = options;
14 const instance = postcss(twPostcss({
15 optimize: builder.config.mode === "production",
16 ...tailwindOptions,
17 }));
18
19 builder.onTransformStaticFile(
20 { pluginName: "tailwind", filter: /\.css$/, exclude },
21 async (args) => {
22 const res = await instance.process(args.text, {
23 from: args.path,
24 });
25 return {
26 content: res.content,
27 map: res.map?.toString(),
28 };
29 },
30 );
31}

Callers 2

dev.tsFile · 0.90
vite.config.tsFile · 0.50

Calls 2

onTransformStaticFileMethod · 0.80
processMethod · 0.80

Tested by

no test coverage detected