Skip to content

Commit 7d168a4

Browse files
fix
1 parent 022008e commit 7d168a4

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

plugin-tailwindcss/src/compiler.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import tailwindPoscss from "@tailwindcss/postcss";
22
import postcss from "postcss";
33
import type { ResolvedFreshConfig } from "fresh";
4-
import type { Processor } from "postcss";
4+
import type { Plugin, Processor } from "postcss";
55

66
export function initTailwind(
77
config: ResolvedFreshConfig,
88
): Processor {
9-
const res = postcss(tailwindPoscss({
10-
optimize: config.mode === "production",
11-
}));
12-
13-
return res;
9+
return postcss([
10+
tailwindPoscss({
11+
optimize: config.mode === "production",
12+
}),
13+
] as Plugin[]);
1414
}

plugin-tailwindcss/src/mod.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ export function tailwind<T>(
1212
{ pluginName: "tailwind", filter: /\.css$/ },
1313
async (args) => {
1414
if (!processor) processor = initTailwind(app.config);
15-
const instance = await processor;
15+
const instance = processor;
1616
const res = await instance.process(args.text, {
1717
from: args.path,
1818
});
19+
1920
return {
2021
content: res.content,
21-
map: res.map?.toString(),
22+
map: res.map.toString(),
2223
};
2324
},
2425
);

0 commit comments

Comments
 (0)