Webpack 5 plugin to create archives of emitted files
npm install webpack-files-archive-pluginnpm install --save-dev webpack-files-archive-plugin
js
let WebpackFilesArchivePlugin = require('webpack-files-archive-plugin');
module.exports = {
// configuration
output: {
path: __dirname + '/dist',
},
plugins: [
new WebpackFilesArchivePlugin(),
],
}
`
Will create two archives in the same directory as output.path (__dirname in the example),
${output.path}.tar.gz and ${output.path}.zip containing all compiled assets.
Options
You can pass options when constructing a new plugin, for example new WebpackFilesArchivePlugin(options).
The options object supports the following properties:
#### output
Type: String
Default: output.path
Directory location of files to be archived.
#### format
Type: String|Array
Default: zip|tar.gz
Archive formats to use, can be 'tar' or 'zip'
#### ext
Type: String
Default: zip|tar.gz
A different extension to use instead of tar.gz or zip (without leading .`)