webpack-files-archive-plugin
v1.0.1
Published
Webpack 5 plugin to create archives of emitted files
Downloads
474
Maintainers
Readme
webpack-files-archive-plugin
Webpack 5 plugin to create archives of emitted files
Installation
npm install --save-dev webpack-files-archive-plugin
This is a fork of original plugin https://github.com/autochthe/webpack-archive-plugin. The current plugin only support Webpack 5. For Webpack 4 use original plugin.
Usage
webpack.config.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 .
)