From 511dec3864a9fa0ba62dc93d9d815cda09dd5123 Mon Sep 17 00:00:00 2001 From: MapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Mon, 3 Jan 2022 01:45:10 -0600 Subject: [PATCH] fix postcss warning with from --- packages/docs-new/src/helpers/tailwind.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/docs-new/src/helpers/tailwind.ts b/packages/docs-new/src/helpers/tailwind.ts index 8bb47ef..2fb0c46 100644 --- a/packages/docs-new/src/helpers/tailwind.ts +++ b/packages/docs-new/src/helpers/tailwind.ts @@ -5,17 +5,20 @@ import type { Result } from "postcss" import postcss from "postcss" import tailwindcss from "tailwindcss" -const tailwindTemplate = await readFile( - fileURLToPath(await import.meta.resolve!("tailwindcss/tailwind.css")), - "utf-8", +const tailwindTemplatePath = fileURLToPath( + await import.meta.resolve!("tailwindcss/tailwind.css"), ) +const tailwindTemplate = await readFile(tailwindTemplatePath, "utf-8") + let result: Result | undefined export function serveTailwindCss(): RequestHandler { return async (req, res) => { if (!result || process.env.NODE_ENV !== "production") { - result = await postcss(tailwindcss).process(tailwindTemplate) + result = await postcss(tailwindcss).process(tailwindTemplate, { + from: tailwindTemplatePath, + }) } res.set("Content-Type", "text/css").send(result.css) }