fix: responsive fix

This commit is contained in:
2024-02-22 19:49:13 +00:00
parent efe51a9b5e
commit b232410d83
13 changed files with 209 additions and 129 deletions
+2 -7
View File
@@ -1,20 +1,14 @@
import postcssPlugin from "postcss";
import tailwindcss from "tailwindcss";
import cssnano from "cssnano";
import { fileExists, getProjectDir } from "~/server/lib/utils";
import { FileSchema } from "~/server/db/schema/file";
import { unpackProject } from "~/server/lib/unpack-project";
export const postcss = async (fileData: FileSchema) => {
const content = fileData.content || "";
const projectDir = getProjectDir();
if (!fileExists(projectDir)) {
return content;
}
try {
await unpackProject({ ext: "ts,tsx,js,jsx,html" });
const projectDir = await unpackProject({ ext: "ts,tsx,js,jsx,html" });
const result = await postcssPlugin([
tailwindcss({
@@ -29,6 +23,7 @@ export const postcss = async (fileData: FileSchema) => {
return result.css;
} catch (err) {
console.error("postcss error", err);
return content;
}
};