Skip to content

[Feature]: Expose moduleGraph.getUsedExports #12731

@SkReD

Description

@SkReD

What problem does this feature solve?

  1. Necessary for external analysis of the modules used in order to ensure efficiency of their usage in federation sharing.
  2. Align with webpack public api

What does the proposed API of configuration look like?

export default class ModuleGraph {
  static __from_binding(binding: JsModuleGraph) {
    return new ModuleGraph(binding);
  }

  #inner: JsModuleGraph;

  constructor(binding: JsModuleGraph) {
    this.#inner = binding;
  }

  ...

  getUsedExports(module: Module, runtime: string | string[]): boolean | Array<string> | null {
    return this.#inner.getUsedExports(module, runtime);
  }

  ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending triageThe issue/PR is currently untouched.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions