Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@packmule/compression-pack

2.0.1-next.405 • Public • Published

Compression Pack npm-latest

Generate gzip and brotli versions of configured assets.

Compression Pack uses compression-webpack-plugin and libraries like iltorb to create compressed gzip and brotli files.

Overview

Setup

Compression Pack is included in the complete and default editions.

Current Release

npm install --save-dev @packmule/compression-pack

Nightly Build

npm install --save-dev @packmule/compression-pack@nightly

API

CompressionPack({
    extensions: ['html', 'json', 'xml', 'js', 'css', 'svg', 'ttf', 'otf'],
    gzip: true,
    brotli: true,
    ratio: 1,
});

Hints

  • optimize - Controls whether the pack is actually enabled or not.
  • cache - Controls cache utilization for the compression libraries.

Usage

Example

Generate compressed files.

import Packmule from '@packmule/core';
import CompressionPack from '@packmule/compression-pack';
 
const packmule = new Packmule();
 
if (env.production) {
    packmule.add(new CompressionPack());
}
 
return packmule.generate();

License

MIT


Install

npm i @packmule/[email protected]

Version

2.0.1-next.405

License

MIT

Unpacked Size

10 kB

Total Files

11

Last publish

Collaborators

  • avatar
  • avatar