Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/module-minifier

module-minifier package

This library wraps terser in convenient handles for parallelization. It powers @rushstack/webpack4-module-minifier-plugin and @rushstack/webpack5-module-minifier-plugin but has no coupling with webpack.

Classes

Class

Description

LocalMinifier

Minifier implementation that minifies code on the main thread.

MessagePortMinifier

Minifier implementation that outsources requests to the other side of a MessagePort

NoopMinifier

Minifier implementation that does not actually transform the code, for debugging.

WorkerPoolMinifier

Minifier implementation that uses a thread pool for minification.

Functions

Function

Description

getIdentifier(ordinal)

Gets a base54 string suitable for use as a JavaScript identifier, omitting those that are valid ECMAScript keywords

Interfaces

Interface

Description

ILocalMinifierOptions

Options for configuring the LocalMinifier

IMinifierConnection

Metadata from the minifier for the plugin

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 chunk of code

IWorkerPoolMinifierOptions

Options for configuring the WorkerPoolMinifier

Type Aliases

Type Alias

Description

IModuleMinificationResult

Result from the minifier.