compression-webpack-plugin
- Version 11.1.0
- Published
- 37.1 kB
- 2 dependencies
- MIT license
Install
npm i compression-webpack-plugin
yarn add compression-webpack-plugin
pnpm add compression-webpack-plugin
Overview
Prepare compressed versions of assets to serve them with Content-Encoding
Index
Classes
Type Aliases
Classes
class CompressionPlugin
class CompressionPlugin<T = import('zlib').ZlibOptions> implements WebpackPluginInstance {}
[T=ZlibOptions] WebpackPluginInstance
constructor
constructor( options?: BasePluginOptions<T> & ( | { algorithm?: string | AlgorithmFunction<T>; compressionOptions?: InferDefaultType<T>; } | { algorithm: string | AlgorithmFunction<T>; compressionOptions?: InferDefaultType<T>; } ));
Parameter options
method apply
apply: (compiler: any) => void;
Parameter compiler
Returns
{void}
Type Aliases
type AlgorithmFunction
type AlgorithmFunction<T> = ( input: Buffer, options: CompressionOptions<T>, callback: ( error: Error | null | undefined, result: | string | ArrayBuffer | SharedArrayBuffer | Uint8Array | readonly number[] | { valueOf(): ArrayBuffer | SharedArrayBuffer; } | { valueOf(): string | Uint8Array | readonly number[]; } | { valueOf(): string; } | { [Symbol.toPrimitive](hint: 'string'): string; } ) => void) => any;
type Asset
type Asset = import('webpack').Asset;
type BasePluginOptions
type BasePluginOptions<T> = { test?: Rules | undefined; include?: Rules | undefined; exclude?: Rules | undefined; threshold?: number | undefined; minRatio?: number | undefined; deleteOriginalAssets?: DeleteOriginalAssets | undefined; filename?: Filename | undefined;};
type Compilation
type Compilation = import('webpack').Compilation;
type Compiler
type Compiler = import('webpack').Compiler;
type CompressionOptions
type CompressionOptions<T> = InferDefaultType<T>;
type CustomOptions
type CustomOptions = { [key: string]: any;};
type DefinedDefaultAlgorithmAndOptions
type DefinedDefaultAlgorithmAndOptions<T> = T extends ZlibOptions ? { algorithm?: string | AlgorithmFunction<T> | undefined; compressionOptions?: CompressionOptions<T> | undefined; } : { algorithm: string | AlgorithmFunction<T>; compressionOptions?: CompressionOptions<T> | undefined; };
type DeleteOriginalAssets
type DeleteOriginalAssets = | boolean | 'keep-source-map' | ((name: string) => boolean);
type Filename
type Filename = string | ((fileData: PathData) => string);
type InferDefaultType
type InferDefaultType<T> = T extends infer U ? U : CustomOptions;
type InternalPluginOptions
type InternalPluginOptions<T> = BasePluginOptions<T> & { algorithm: string | AlgorithmFunction<T>; compressionOptions: CompressionOptions<T>; threshold: number; minRatio: number; deleteOriginalAssets: DeleteOriginalAssets; filename: Filename;};
type PathData
type PathData = { [key: string]: any;};
type Rule
type Rule = RegExp | string;
type Rules
type Rules = Rule[] | Rule;
type Schema
type Schema = import('schema-utils/declarations/validate').Schema;
type Source
type Source = import('webpack').sources.Source;
type WebpackError
type WebpackError = import('webpack').WebpackError;
type WebpackPluginInstance
type WebpackPluginInstance = import('webpack').WebpackPluginInstance;
type WithImplicitCoercion
type WithImplicitCoercion<T> = | T | { valueOf(): T; };
type ZlibOptions
type ZlibOptions = import('zlib').ZlibOptions;
Package Files (1)
Dependencies (2)
Dev Dependencies (29)
- @babel/cli
- @babel/core
- @babel/preset-env
- @commitlint/cli
- @commitlint/config-conventional
- @gfx/zopfli
- @types/node
- @types/serialize-javascript
- @webpack-contrib/eslint-config-webpack
- babel-jest
- cross-env
- cspell
- del
- del-cli
- eslint
- eslint-config-prettier
- eslint-plugin-import
- file-loader
- husky
- jest
- lint-staged
- memfs
- npm-run-all
- prettier
- standard-version
- typescript
- webpack
- webpack-stats-plugin
- workbox-webpack-plugin
Peer Dependencies (1)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/compression-webpack-plugin
.
- Markdown[](https://www.jsdocs.io/package/compression-webpack-plugin)
- HTML<a href="https://www.jsdocs.io/package/compression-webpack-plugin"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3527 ms. - Missing or incorrect documentation? Open an issue for this package.