RoadmapShopEvents
Skip to main content

Home > @rushstack/module-minifier-plugin

module-minifier-plugin package

Classes

ClassDescription
LocalMinifierMinifier implementation that minifies code on the main thread.
ModuleMinifierPluginWebpack plugin that minifies code on a per-module basis rather than per-asset. The actual minification is handled by the input minifier object.
NoopMinifierMinifier implementation that does not actually transform the code, for debugging.
PortableMinifierModuleIdsPluginPlugin 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.
WorkerPoolMinifierMinifier implementation that uses a thread pool for minification.

Functions

FunctionDescription
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

InterfaceDescription
IAssetInfoInformation about a dehydrated webpack ECMAScript asset
IDehydratedAssetsThe set of data remaining to rehydrate in the current compilation
IExtendedModuleExtension of the webpack Module typings with members that are used by this Plugin
ILocalMinifierOptionsOptions for configuring the LocalMinifier
IMinifierConnectionMetadata from the minifier for the plugin
IModuleInfoInformation about a minified module
IModuleMinificationCallbackCallback passed to a minifier function
IModuleMinificationErrorResultResult from the minifier function when an error is encountered.
IModuleMinificationRequestRequest to the minifier
IModuleMinificationSuccessResultResult from the minifier on a successful minification.
IModuleMinifierObject that can be invoked to minify code.
IModuleMinifierFunctionAn async function called to minify a module (or dehydrated chunk)
IModuleMinifierPluginHooksHooks provided by the ModuleMinifierPlugin
IModuleMinifierPluginOptionsOptions to the ModuleMinifierPlugin constructor
IPostProcessFragmentContextArgument to the postProcessCodeFragment hook for the current execution context
IWorkerPoolMinifierOptionsOptions for configuring the WorkerPoolMinifier

Variables

VariableDescription
CHUNK_MODULES_TOKENToken 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_DIGITSThe sorted sequence of leading digits for mangled identifiers Computed from character frequency analysis of the source code for OneDrive
IDENTIFIER_TRAILING_DIGITSThe sorted sequence of trailing digits for mangled identifiers Computed from character frequency analysis of the source code for OneDrive
MODULE_WRAPPER_PREFIXPrefix 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_SUFFIXSuffix 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_AFTERStage # to use when this should be the last tap in the hook
STAGE_BEFOREStage # to use when this should be the first tap in the hook

Type Aliases

Type AliasDescription
IAssetMapA map from file names to dehydrated assets
IModuleMapA map from module ids to minified modules
IModuleMinificationResultResult from the minifier.