Home Reference Source
import {ProjextRollupCompressionPlugin} from 'projext-plugin-rollup/src/plugins/compression/index.js'
public class | source

ProjextRollupCompressionPlugin

This is a Rollup plugin that takes all the files that match an specific filter and compress using Gzip.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

The filter to decide which files will be compressed and which won't.

public

The name of the plugin instance.

Method Summary

Public Methods
public

Gets the plugin options

public

This method gets called after Rollup writes the files on the file system.

Public Constructors

public constructor(options: ProjextRollupCompressionPluginOptions, name: string) source

Params:

NameTypeAttributeDescription
options ProjextRollupCompressionPluginOptions
  • optional
  • default: {}

The options to customize the plugin behaviour.

name string
  • optional
  • default: 'projext-rollup-plugin-compression'

The name of the plugin's instance.

Public Members

public filter: RollupFilter source

The filter to decide which files will be compressed and which won't.

public name: string source

The name of the plugin instance.

Public Methods

public getOptions(): ProjextRollupCompressionPluginOptions source

Gets the plugin options

public writeBundle(): Promise<Array, Error> source

This method gets called after Rollup writes the files on the file system. It takes care of finding all the files that match the filter and compressing them with Gzip.

Return:

Promise<Array, Error>

If everything goes well, the Promise will resolve on a list of ProjextRollupCompressionPluginEntry objects.