Webpack plugin to create archives of emitted files.
npm install --save-dev webpack-archiver-plugin
webpack.config.js:
const ArchiverPlugin = require('webpack-archiver-plugin');
module.exports = {
// configuration
output: {
path: '/dist',
},
plugins: [
new ArchiverPlugin({
name: 'dist',
ext: '.tar',
}),
],
}
Will create a archive in the same directory as output.path (__dirname
in the example),
${output.path}.tar.gz
contains all compiled assets.
You can pass options when constructing a new plugin, for example ArchivePlugin(options)
.
The options object supports the following properties:
- name:
string
-> Output name of archives (without extension) - ext:
string
-> A different extension to use instead of ``.tar,
.tar.gz` or `zip`
If options
is a string, this is eqiuvalent to passing {output: options}
.