JSPM

@laomao800/webpack-archive-plugin

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 132
  • Score
    100M100P100Q87489F
  • License MIT

Webpack plugin to create archives of emitted files.

Package Exports

  • @laomao800/webpack-archive-plugin

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@laomao800/webpack-archive-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

webpack-archive-plugin

Webpack plugin to create archives of emitted files.

Installation

# for webpack 4.x
npm install --save-dev @laomao800/webpack-archive-plugin
# for webpack < 4
npm install --save-dev @laomao800/webpack-archive-plugin@1.x

Usage

webpack.config.js:

const ArchivePlugin = require('@laomao800/webpack-archive-plugin');

module.exports = {
  // ...
  output: {
    path: path.join(__dirname, 'dist'),
    filename: 'bundle.js'
  },
  plugins: [
    new ArchivePlugin({
      // the output location, can be relative (to Webpack output path) or absolute
      output: '',

      // output archive filename, defaults to the Webpack output filename (above),
      // if not present, use the basename of the path
      filename: '',

      // defaults to the array ['zip', 'tar']
      // valid format is 'zip' and 'tar', can be a string or an array,
      format: '',

      // OPTIONAL: defaults to the empty string
      // the file extension to use instead of 'zip' or 'tar.gz'
      // if 'format' is Array, extension needs to be like { zip: 'zipext', tar: 'tarext' }
      extension: '',

      // OPTIONAL: defaults to the empty string
      // the prefix for the files included in the zip/tar.gz file
      pathPrefix: 'relative/path'
    })
  ],
}

Will create two archives in the same directory as output.path (__dirname/dist in the example), ${output.filename}.tar.gz and ${output.filename}.zip containing all compiled assets.