From a8633075f7e46f0a5e593dbaba3becb525d34f5b Mon Sep 17 00:00:00 2001 From: shadcn Date: Thu, 7 Nov 2024 20:36:21 +0400 Subject: [PATCH] fix(www): component source --- apps/www/lib/rehype-component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/www/lib/rehype-component.ts b/apps/www/lib/rehype-component.ts index 17dd2a0b16..0a3b0ed1a3 100644 --- a/apps/www/lib/rehype-component.ts +++ b/apps/www/lib/rehype-component.ts @@ -42,12 +42,12 @@ export function rehypeComponent() { file.endsWith(`${fileName}.tsx`) || file.endsWith(`${fileName}.ts`) ) - }) || component.files[0] - : component.files[0] + }) || component.files[0]?.path + : component.files[0]?.path } // Read the source file. - const filePath = path.join(process.cwd(), src) + const filePath = src let source = fs.readFileSync(filePath, "utf8") // Replace imports.