diff --git a/apps/website/src/data/blocks/components.ts b/apps/website/src/data/blocks/components.ts index 526bd3a5e..f4b4c1821 100644 --- a/apps/website/src/data/blocks/components.ts +++ b/apps/website/src/data/blocks/components.ts @@ -59,12 +59,9 @@ function getComponentCode(componentFolder: string, componentName: string) { } const getRootFolder = () => { - return ( - process.env.TEMPLATE_ROOT || - path.join( - process.env.PROJECT_CWD ?? __dirname + '/../../../../', - '/packages/pro/saas-ui/templates/src' - ) + return path.join( + process.env.PROJECT_CWD ?? __dirname + '/../../../../', + '/packages/pro/saas-ui/templates/src' ) } @@ -112,7 +109,7 @@ export function getAllComponents(): ComponentInfo[] { export function getComponent( categoryName: string, componentName: string, - rootFolder = getRootFolder() + rootFolder = process.env.TEMPLATE_ROOT || getRootFolder() ): ComponentInfo | null { console.log('rootFolder', rootFolder) const componentDirectory = path.join(rootFolder, categoryName, componentName)