The Plugin
SharedLibraryWebpackPlugin
is a class that implements webpack plugin functionality,Description
Example
string | 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: '@'}
});
Description
Example
string
The namespace for saving exported libraries
{
namespace: "__shared_libraries__"
}
Description
Example
boolean
By default:
false
If true
jsonpFunction
will be replaced with a random name{
disableDefaultJsonpFunctionChange: false
}
SharedLibrarySearchConfig
configures the search for sharing library and the formation of a chunk name.Description
Example
string
An option to search for libraries in a bundle.
{
pattern: "@angular/**"
}
Description
Example
string
A name to search for a library in a bundle.
{
name: "@angular/core"
}
Description
Example
string
A name of a shared chunk
If a pattern exists
chunkName
is ignored{
chunkName: "ng"
}
Description
Example
string
A chunk name suffix
By default library version
{major}.{minor}-{prerelease}
{
suffix: 'suffix'
}
Description
Example
string
Separator for a chunk name and suffix
{
separator: "@"
}
Description
Example
string[]
Libraries that the current one depends on.
new SharedLibraryWebpackPlugin({
libs: [
'@angular/**',
{name: '@tinkoff/angular-ui', deps: ['@angular/core']}
]
})
Description
Example
string[]
The import names to be used by another application
{name: '@angular/core', usedExports: ['DomSanitizer']}
Last modified 2yr ago