RoadmapShopEvents
Skip to main content

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

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

Functions

FunctionDescription
generateLicenseFileForAsset(compilation, asset)Generates a companion asset containing all extracted comments. If it is non-empty, returns a banner comment directing users to said companion asset.

Interfaces

InterfaceDescription
IAssetInfoInformation about a dehydrated webpack ECMAScript asset
IDehydratedAssetsThe set of data remaining to rehydrate in the current compilation
IFactoryMetaProperties surfaced via the factoryMeta property on webpack modules
IModuleInfoInformation about a minified module
IModuleMinifierPluginHooksHooks provided by the ModuleMinifierPlugin
IModuleMinifierPluginOptionsOptions to the ModuleMinifierPlugin constructor
IModuleMinifierPluginStatsStatistics from the plugin. Namely module sizes.
IModuleStatsModule size data as a function of the target chunk.
IPostProcessFragmentContextArgument to the postProcessCodeFragment hook for the current execution context

Variables

VariableDescription
CHUNK_MODULE_REGEXRegExp for replacing chunk module placeholders
CHUNK_MODULE_TOKENToken preceding a module id in the emitted asset so 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