Skip to content

Commit

Permalink
chore: debug tailwind
Browse files Browse the repository at this point in the history
  • Loading branch information
ynwd committed Aug 13, 2024
1 parent 13b0f1b commit 8a91336
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions middleware/tailwind/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,18 @@ function render(content: string) {
});
}

const twc = await import(Deno.cwd() + "/tailwind.config.ts");
console.log("twc", twc);
if (!twc && !twc.default) throw new Error("tailwind.config.ts is needed");
async function getPath() {
let twc;
try {
twc = await import(Deno.cwd() + "/tailwind.config.ts");
} catch (_err) {
twc = await import("../../tailwind.config.ts");
}
return twc;
}

const twc = await getPath();

function createProcessor(
config: {
staticDir: string;
Expand Down

0 comments on commit 8a91336

Please sign in to comment.