This commit is contained in:
Alex
2025-01-24 01:29:15 -05:00
parent 5a3b03b69b
commit 4db894d061
27 changed files with 1985 additions and 2063 deletions

View File

@ -1,14 +1,15 @@
import hash from "@emotion/hash";
import { transformSync } from "esbuild";
import { memoize, without } from "lodash-es";
import type postcss from "postcss";
import type { Config } from "tailwindcss";
import type { SetRequired } from "type-fest";
import { transformSync } from "esbuild";
import type postcss from "postcss";
import { memoize, without } from "lodash";
import { type ClassNameCollector, babelTailwind } from "./babel/index";
import { toJSCode } from "./css-to-js";
import { esbuildPlugin } from "./esbuild-postcss";
import { vitePlugin } from "./vite-plugin";
import { type StyleMap, createPostCSS } from "./shared";
import { convertCssToJS } from "./css-to-js";
import { vitePlugin } from "./vite-plugin";
export { isMacrosName } from "./vite-plugin";
@ -156,7 +157,7 @@ export function getTailwindPlugins(options: TailwindPluginOptions) {
if (path.endsWith(".css")) {
return ["css", transformSync(compiled, { loader: "css" }).code] as const;
} else if (path.endsWith(".js")) {
const js = convertCssToJS(compiled, x => x.slice(1));
const js = toJSCode(compiled, x => x.slice(1));
return ["js", js] as const;
} else {
throw new Error("Unknown file extension");