Angular Modernizer
    Preparing search index...

    Angular module detector

    Detects Angular module boundaries and lazy-loading patterns. Uses ts-morph to parse @NgModule decorators and extract metadata. Lazy-loaded modules are identified via RouterModule.forChild patterns.

    const detector = new AngularModuleDetector(project);
    const module = detector.getModuleForFile('src/app/app.module.ts');
    if (module?.isLazy) {
    console.info('This is a lazy-loaded module');
    }
    Index

    Constructors

    Methods

    • Clear module cache

      Returns void

    • Find module that declares a component

      Given a component file path, finds which module declares it.

      Parameters

      • componentPath: string

        Component file path

      Returns AngularModuleBoundary | null

      Module boundary or null

    • Get affected modules for changed files

      Given a set of changed files, determines which modules are affected. A module is affected if any of its declarations changed, or if the module file itself changed.

      Parameters

      • changedFiles: string[]

        Array of changed file paths

      Returns AngularModuleBoundary[]

      Array of affected modules

    • Get module dependencies

      Returns modules imported by this module.

      Parameters

      • filePath: string

        Module file path

      Returns string[]

      Array of imported module file paths

    • Get module boundary for a file

      Searches for @NgModule decorator and parses metadata. Returns null if file is not a module.

      Parameters

      • filePath: string

        File path to analyze

      Returns AngularModuleBoundary | null

      Module boundary or null