(
builder: Builder,
options: TailwindPluginOptions = {},
)
| 51 | } |
| 52 | |
| 53 | export function tailwind( |
| 54 | builder: Builder, |
| 55 | options: TailwindPluginOptions = {}, |
| 56 | ): void { |
| 57 | const processor = initTailwind(builder.config, options); |
| 58 | |
| 59 | builder.onTransformStaticFile( |
| 60 | { pluginName: "tailwind", filter: /\.css$/ }, |
| 61 | async (args) => { |
| 62 | const instance = await processor; |
| 63 | const res = await instance.process(args.text, { |
| 64 | from: args.path, |
| 65 | }); |
| 66 | return { |
| 67 | content: res.content, |
| 68 | map: res.map?.toString(), |
| 69 | }; |
| 70 | }, |
| 71 | ); |
| 72 | } |
| 73 | |
| 74 | const CONFIG_EXTENSIONS = ["ts", "js", "mjs"]; |
| 75 |
nothing calls this directly
no test coverage detected