RoadmapShopEvents
Skip to main content

Home > @rushstack/webpack4-module-minifier-plugin

webpack4-module-minifier-plugin package

Classes

ClassDescription
ModuleMinifierPluginWebpack plugin that minifies code on a per-module basis rather than per-asset. The actual minification is handled by the input minifier object.
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.

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.
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
IModuleInfoInformation about a minified module
IModuleMinifierPluginHooksHooks provided by the ModuleMinifierPlugin
IModuleMinifierPluginOptionsOptions to the ModuleMinifierPlugin constructor
IPostProcessFragmentContextArgument to the postProcessCodeFragment hook for the current execution context

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
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