0.0.3 • Published 5 years ago
webpack-archiver-plugin v0.0.3
webpack-archiver-plugin
Webpack plugin to create archives of emitted files.
Installation
npm install --save-dev webpack-archiver-plugin
Usage
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.
Options
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.gzor
zip`
If options
is a string, this is eqiuvalent to passing {output: options}
.