@sharingbox/zip-compression-webpack-plugin

1.0.1 • Public • Published

zip-compression-webpack-plugin

Create zip folders into your webpack bundle. Uses archiver behind the scene (a streaming interface for archive generation).

npm version

Installation

npm install @sharingbox/zip-compression-webpack-plugin --save-dev

Usage

List of actions to perform (Array of objects). Each object must have 4 properties:

  • from: string
  • name: string
  • to: string
  • deleteOriginalAssets: boolean

from (string)

Path of the folder you want to zip (relative path from the root of your project).

name (string)

Name of the generated zip that will be added to your Webpack bundle (needs the .zip extension).

to (string)

Path of the folder you want your generated zip to be moved to (relative path from the root of your project).

deleteOriginalAssets (boolean)

Remove the original assets you have added to your generated zip.

const ZipFolderWebpackPlugin = require('@sharingbox/zip-compression-webpack-plugin');

const configuration = {

    plugins: [

        new ZipFolderWebpackPlugin([

			{

				from                : './node_modules/@sharingbox/documents-A',
				name                : 'documents-A.zip',
				to                  : './dist/zip',
				deleteOriginalAssets: false

			},

			{

				from                : './src/assets/documents-B',
				name                : 'documents-B.zip',
				to                  : './dist/zip',
				deleteOriginalAssets: true

			}

		])

    ]

};

Readme

Keywords

Package Sidebar

Install

npm i @sharingbox/zip-compression-webpack-plugin

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

5.33 kB

Total Files

5

Last publish

Collaborators

  • stelsharingbox
  • nicolasmondain
  • julienr
  • 4n7h0
  • frddns