@sharingbox/zip-compression-webpack-plugin
v1.0.1
Published
Create zip folders into your webpack bundle
Downloads
5
Readme
zip-compression-webpack-plugin
Create zip folders into your webpack bundle.
Uses archiver
behind the scene (a streaming interface for archive generation).
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
: stringname
: stringto
: stringdeleteOriginalAssets
: 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
}
])
]
};