fix: code view for mdx

This commit is contained in:
shadcn
2024-11-07 17:45:34 +04:00
parent 8f0c26f22a
commit 432d5e6e28

View File

@@ -106,10 +106,10 @@ export function rehypeComponent() {
try {
for (const style of styles) {
const component = Index[style.name][name]
const src = component.files[0]
const src = 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.