Angular Modernizer
    Preparing search index...
    • Resolve platform root directory (the monorepo root) by searching upward for a package.json with workspaces.

      ANGULAR_MODERNIZER_PLATFORM_ROOT takes precedence when set; without a match the fallback path relative to currentDir is used.

      Parameters

      • currentDir: string

        Starting directory for upward search (typically __dirname)

      • fallbackPath: string

        Fallback relative path if monorepo root not found (e.g., '../../../..')

      Returns string

      Absolute path to platform root directory

      import { fileURLToPath } from 'node:url';
      import * as path from 'node:path';

      const __filename = fileURLToPath(import.meta.url);
      const __dirname = path.dirname(__filename);

      const platformRoot = resolvePlatformRoot(__dirname, '../../../..');