fix(www): component source

This commit is contained in:
shadcn
2024-11-07 20:36:21 +04:00
parent 432d5e6e28
commit a8633075f7

View File

@@ -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.