Angular Modernizer
    Preparing search index...

    Resolves import / export module specifiers (tsconfig path aliases, relative paths, directory index files) to absolute source file paths using the TypeScript compiler's own module resolution. Shared by the layer boundary rule and the import graph used for cycle detection.

    Classic module resolution is replaced by Node10 so index.ts files are probed; with Node16/NodeNext, extensionless relative imports are retried with bundler resolution. Results are cached per directory and specifier.

    External library imports (node_modules) resolve to null. Declaration files are only returned when they belong to the project (not in node_modules).

    Index

    Constructors

    • Parameters

      • options: CompilerOptions

        Compiler options (paths, baseUrl, moduleResolution)

      • host: ModuleResolutionHost

        File system access for the resolution

      Returns ModuleResolver

    Methods

    • Compiler options used for resolution (after the module resolution fallback described above).

      Returns CompilerOptions

    • Resolve moduleSpecifier imported from fromFile to an absolute path, or null if it cannot be resolved or points to an external library.

      Parameters

      • moduleSpecifier: string
      • fromFile: string

      Returns string | null

    • Resolver reading from disk with the given compiler options.

      Parameters

      • options: CompilerOptions

      Returns ModuleResolver

    • Resolver bound to a ts-morph project (works with in-memory file systems).

      Parameters

      • project: Project

      Returns ModuleResolver