mirror of
https://github.com/khairul169/code-share.git
synced 2026-10-24 11:53:58 +07:00
fix: responsive fix
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user