shareScope
shareScope specifies which shared dependency pools (Share Scope) a producer participates in. You can think of a Share Scope as a named shared-dependency pool: dependencies are only reused within the same Scope.
- Type:
string | string[] - Required: No
- Default:
'default'
What It Does
- Controls which Share Scopes a producer initializes at runtime.
- Works with
shared[*].shareScope: a shared dependency only participates in the Scope it is assigned to. - Works with
remotes[remote].shareScope: the consumer must align the Scopes it wants to reuse with the producer, otherwise missing Scopes are treated as empty and cannot be reused.
Examples
Single Scope (Default)
Multiple Scopes (Isolated Shared Pools)
Notes
shareScopedeclares which Share Scopes this module initializes. It does not automatically put dependencies into those Scopes; that is controlled by eachsharedentry'sshareScope.- To actually reuse dependencies across apps, the producer and consumer typically need to agree on the same Scopes. See remotes.shareScope.