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

@ -39,3 +39,14 @@ exports[`babel-tailwind > supports grouped tw 2`] = `
font-weight: 600;
}"
`;
exports[`babel-tailwind > supports styled components usage 1`] = `
"import { classed as _classed } from "@aet/tailwind/classed";
var Div = _classed("div", "tw-gqn2k6");"
`;
exports[`babel-tailwind > supports styled components usage 2`] = `
".tw-gqn2k6 {
text-align: center;
}"
`;

View File

@ -40,4 +40,20 @@ describe("babel-tailwind", () => {
matchSnapshot(files);
});
it("supports styled components usage", async () => {
const { files } = await compileESBuild({
clsx: "emotion",
expectFiles: 2,
javascript: `
import {tw} from "@aet/tailwind/macro";
const Div = tw.div\`
text-center
\`;
`,
});
matchSnapshot(files);
});
});

View File

@ -47,7 +47,14 @@ export function getBuild(name: string) {
const result = await esbuild.build({
bundle: true,
write: false,
external: ["react/jsx-runtime", "@emotion/css", "clsx", "tslib"],
external: [
"react",
"react/jsx-runtime",
"@emotion/css",
"clsx",
"tslib",
"@aet/tailwind/classed",
],
outdir: "dist",
format: "esm",
entryPoints: [await write("index.tsx", dedent(javascript))],