archiver-webpack-plugin

1.2.0 • Public • Published

npm node dependencies test semantic-release

Archiver Plugin

Generate a compressed archive of compiled assets.

Table of Contents

Installation

npm install archiver archiver-webpack-plugin --save-dev

Usage

Using the built-in Archiver instance

const ArchiverPlugin = require("archiver-webpack-plugin");
 
module.exports = {
  plugins: [
    new ArchiverPlugin({
      format: "zip",
      formatOptions: {
        zlib: {
          level: 9,
        },
      },
    }),
  ],
};

Using a custom Archiver instance

const ArchiverPlugin = require("archiver-webpack-plugin");
const archiver = require("archiver");
 
const archive = archiver("zip", {
  zlib: {
    level: 9,
  },
});
 
module.exports = {
  plugins: [
    new ArchiverPlugin({
      archive,
    }),
  ],
};

Arguments:

  • output: The archive output path.
  • test: All assets matching this RegExp are processed. Defaults to every asset.
  • format: The archive format. Defaults to "zip".
  • formatOptions: The archive format options. Defaults to "{}".
  • archive: An Archiver instance. Defaults to the built-in instance.

API

See the detailed API Reference.

Author

Alexandre Breteau - @0xSeldszar

License

MIT © Alexandre Breteau

Package Sidebar

Install

npm i archiver-webpack-plugin

Weekly Downloads

1

Version

1.2.0

License

MIT

Unpacked Size

7.05 kB

Total Files

4

Last publish

Collaborators

  • seldszar