Skip to content

Commit 4c8c7c8

Browse files
committed
fix: fix css plugin transform handler
1 parent 3336797 commit 4c8c7c8

File tree

1 file changed

+6
-2
lines changed
  • examples/react-server/src/features/unocss

1 file changed

+6
-2
lines changed

examples/react-server/src/features/unocss/plugin.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,12 @@ export function vitePluginSharedUnocss(): PluginOption {
9393
await ctx.flushTasks();
9494
let { css } = await ctx.uno.generate(ctx.tokens);
9595
for (const plugin of cssPlugins) {
96-
tinyassert(typeof plugin.transform === "function");
97-
const result = await plugin.transform.apply(this as any, [
96+
const handler =
97+
"handler" in plugin.transform
98+
? plugin.transform.handler
99+
: plugin.transform;
100+
tinyassert(typeof handler === "function");
101+
const result = await handler.apply(this as any, [
98102
css,
99103
"\0virtual:unocss.css",
100104
]);

0 commit comments

Comments
 (0)