Home > @rushstack/module-minifier-plugin
module-minifier-plugin package
Classes
Class | Description |
---|---|
LocalMinifier | Minifier implementation that minifies code on the main thread. |
ModuleMinifierPlugin | Webpack plugin that minifies code on a per-module basis rather than per-asset. The actual minification is handled by the input minifier object. |
NoopMinifier | Minifier implementation that does not actually transform the code, for debugging. |
PortableMinifierModuleIdsPlugin | Plugin responsible for converting the Webpack module ids (of whatever variety) to stable ids before code is handed to the minifier, then back again. Uses the node module identity of the target module. Will emit an error if it encounters multiple versions of the same package in the same compilation. |
WorkerPoolMinifier | Minifier implementation that uses a thread pool for minification. |
Functions
Function | Description |
---|---|
generateLicenseFileForAsset(compilation, asset, minifiedModules) | Generates a companion asset containing all extracted comments. If it is non-empty, returns a banner comment directing users to said companion asset. |
getIdentifier(ordinal) | Gets a base54 string suitable for use as a JavaScript identifier, omitting those that are valid ECMAScript keywords |
rehydrateAsset(asset, moduleMap, banner) | Rehydrates an asset with minified modules. |
Interfaces
Interface | Description |
---|---|
IAssetInfo | Information about a dehydrated webpack ECMAScript asset |
IDehydratedAssets | The set of data remaining to rehydrate in the current compilation |
IExtendedModule | Extension of the webpack Module typings with members that are used by this Plugin |
ILocalMinifierOptions | Options for configuring the LocalMinifier |
IMinifierConnection | Metadata from the minifier for the plugin |
IModuleInfo | Information about a minified module |
IModuleMinificationCallback | Callback passed to a minifier function |
IModuleMinificationErrorResult | Result from the minifier function when an error is encountered. |
IModuleMinificationRequest | Request to the minifier |
IModuleMinificationSuccessResult | Result from the minifier on a successful minification. |
IModuleMinifier | Object that can be invoked to minify code. |
IModuleMinifierFunction | An async function called to minify a module (or dehydrated chunk) |
IModuleMinifierPluginHooks | Hooks provided by the ModuleMinifierPlugin |
IModuleMinifierPluginOptions | Options to the ModuleMinifierPlugin constructor |
IPostProcessFragmentContext | Argument to the postProcessCodeFragment hook for the current execution context |
IWorkerPoolMinifierOptions | Options for configuring the WorkerPoolMinifier |
Variables
Variable | Description |
---|---|
CHUNK_MODULES_TOKEN | Token to replace the object or array of module definitions so that the minifier can operate on the Webpack runtime or chunk boilerplate in isolation |
IDENTIFIER_LEADING_DIGITS | The sorted sequence of leading digits for mangled identifiers Computed from character frequency analysis of the source code for OneDrive |
IDENTIFIER_TRAILING_DIGITS | The sorted sequence of trailing digits for mangled identifiers Computed from character frequency analysis of the source code for OneDrive |
MODULE_WRAPPER_PREFIX | Prefix to wrap function (module, webpack_exports, webpack_require) { ... } so that the minifier doesn't delete it. Public because alternate Minifier implementations may wish to know about it. |
MODULE_WRAPPER_SUFFIX | Suffix to wrap function (module, webpack_exports, webpack_require) { ... } so that the minifier doesn't delete it. Public because alternate Minifier implementations may wish to know about it. |
STAGE_AFTER | Stage # to use when this should be the last tap in the hook |
STAGE_BEFORE | Stage # to use when this should be the first tap in the hook |
Type Aliases
Type Alias | Description |
---|---|
IAssetMap | A map from file names to dehydrated assets |
IModuleMap | A map from module ids to minified modules |
IModuleMinificationResult | Result from the minifier. |