The Plugin
SharedLibraryWebpackPlugin
SharedLibraryWebpackPluginSharedLibraryWebpackPlugin is a class that implements webpack plugin functionality,
Options
libs
libsstring | SharedLibrarySearchConfig | Array<string | SharedLibrarySearchConfig>
An option that configures the search for shared libraries and the formation of a chunk name. It can be a string or SharedLibrarySearchConfig or an array of them.
new SharedLibraryWebpackPlugin({
libs: 'lodash'
});
new SharedLibraryWebpackPlugin({
libs: '@angular/**'
});
new SharedLibraryWebpackPlugin({
libs: ['@angular/**', 'zone.js/dist/zone']
});
new SharedLibraryWebpackPlugin({
libs: {name: '@angular/core', chunkName: 'ng', separator: '@'}
});namespace
namespacestring
The namespace for saving exported libraries
{
namespace: "__shared_libraries__"
}disableDefaultJsonpFunctionChange
disableDefaultJsonpFunctionChangeboolean
By default: false
If true jsonpFunction will be replaced with a random name
{
disableDefaultJsonpFunctionChange: false
}SharedLibrarySearchConfig
SharedLibrarySearchConfigSharedLibrarySearchConfig configures the search for sharing library and the formation of a chunk name.
pattern
patternstring
An option to search for libraries in a bundle.
name
namestring
A name to search for a library in a bundle.
chunkName
chunkNamestring
A name of a shared chunk
suffix
suffixstring
A chunk name suffix
By default library version {major}.{minor}-{prerelease}
separator
separatorstring
Separator for a chunk name and suffix
deps
depsstring[]
Libraries that the current one depends on.
usedExports
usedExportsstring[]
The import names to be used by another application
Last updated
Was this helpful?