new ConsumeSharedPlugin(options): ConsumeSharedPluginAttributes
options:
ConsumeSharedPluginOptionsoptions
Returns:
ConsumeSharedPluginCreates an instance of ConsumeSharedPlugin.
Attributes
options:
ConsumeSharedPluginOptionsapply(compiler): voidAttributes
Applies the plugin by registering its hooks on the compiler.
Type:
(string | ConsumesObject)[] | ConsumesObjectAdvanced configuration for modules that should be consumed from share scope.
Attributes
eager:
booleanInclude the fallback module directly instead behind an async request. This allows to use fallback module in initial load too. All possible shared modules need to be eager too.
import:
string | falseFallback module if no shared module is found in share scope. Defaults to the property name.
packageName:
stringPackage name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
requiredVersion:
string | falseVersion requirement from module in share scope.
shareKey:
stringModule is looked up under this key from the share scope.
shareScope:
stringShare scope name.
singleton:
booleanAllow only a single version of the shared module in share scope (disabled by default).
strictVersion:
booleanDo not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).
Options for consuming shared modules.
Attributes
Modules that should be consumed from share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.
[index: {string}]string | ConsumesConfig