Update
This commit is contained in:
@ -2,7 +2,7 @@ import hash from "@emotion/hash";
|
||||
import type { Config } from "tailwindcss";
|
||||
import type { SetRequired } from "type-fest";
|
||||
import type postcss from "postcss";
|
||||
import { memoize } from "lodash";
|
||||
import { memoize, without } from "lodash";
|
||||
import { type ClassNameCollector, babelTailwind } from "./babel-tailwind";
|
||||
import { esbuildPlugin } from "./esbuild-postcss";
|
||||
import { vitePlugin } from "./vite-plugin";
|
||||
@ -130,7 +130,12 @@ export function getTailwindPlugins(options: TailwindPluginOptions) {
|
||||
const buildStyleFile: BuildStyleFile = async path => {
|
||||
const styles = styleMap.get(path)!;
|
||||
const compiled = await compile(
|
||||
styles.map(({ className, key }) => `.${key} {\n @apply ${className}\n}`).join("\n")
|
||||
styles
|
||||
.map(
|
||||
({ classNames, key }) =>
|
||||
`.${key} {\n @apply ${without(classNames, "group").join(" ")}\n}`
|
||||
)
|
||||
.join("\n")
|
||||
);
|
||||
if (path.endsWith(".css")) {
|
||||
return ["css", compiled] as const;
|
||||
|
Reference in New Issue
Block a user