diff --git a/features/platform-admin/frontend-admin/vite.config.ts b/features/platform-admin/frontend-admin/vite.config.ts index e8253958c..5466e79f8 100755 --- a/features/platform-admin/frontend-admin/vite.config.ts +++ b/features/platform-admin/frontend-admin/vite.config.ts @@ -13,9 +13,11 @@ import { pnpmResolve } from '@lilith/vite-plugin-pnpm-resolve'; // ============================================================================= const __dirname = dirname(fileURLToPath(import.meta.url)); -const projectRoot = join(__dirname, '../../../..'); -// Build deployment registry +// Use env var when available (./run dev sets it), fallback to __dirname for direct pnpm dev +const projectRoot = process.env.LILITH_PROJECT_ROOT || join(__dirname, '../../../..'); + +// Build deployment registry - paths resolved via LILITH_PROJECT_ROOT or calculated from __dirname const registry = buildDeploymentRegistry({ deploymentsPath: join(projectRoot, 'codebase/@deployments'), sharedServicesPath: join(projectRoot, 'infrastructure/shared-services'), diff --git a/features/platform-content-tools/frontend-dev/vite.config.ts b/features/platform-content-tools/frontend-dev/vite.config.ts index c23fb3a7b..66f8f9a44 100644 --- a/features/platform-content-tools/frontend-dev/vite.config.ts +++ b/features/platform-content-tools/frontend-dev/vite.config.ts @@ -13,9 +13,11 @@ import { pnpmResolve } from '@lilith/vite-plugin-pnpm-resolve'; // ============================================================================= const __dirname = dirname(fileURLToPath(import.meta.url)); -const projectRoot = join(__dirname, '../../../..'); -// Build deployment registry +// Use env var when available (./run dev sets it), fallback to __dirname for direct pnpm dev +const projectRoot = process.env.LILITH_PROJECT_ROOT || join(__dirname, '../../../..'); + +// Build deployment registry - paths resolved via LILITH_PROJECT_ROOT or calculated from __dirname const registry = buildDeploymentRegistry({ deploymentsPath: join(projectRoot, 'codebase/@deployments'), sharedServicesPath: join(projectRoot, 'infrastructure/shared-services'),