2.5.26 • Published 21 days ago

@dumlj/zip-webpack-plugin v2.5.26

Weekly downloads
-
License
MIT
Repository
github
Last release
21 days ago

License: MIT  Github Repo  NPM Version  See Docs  codecov  DeepSource 

Zip Webpack Plugin

Compressed to zip webpack plugin

BACKGROUND

Sometimes we need to push the entire project to a certain system by uploading zip, such as ci/cd, Chrome Extension, etc. So it is most convenient to use a compressed file.

FEATURE

  • Automatically collect emitted files by webpack.
  • Trim other files by setting the onlyZip option.
  • Implemented using jszip.

INSTALL

# use npm
$ npm install --dev @dumlj/zip-webpack-plugin
# use yarn
$ yarn add --dev @dumlj/zip-webpack-plugin
# use pnpm
$ pnpm add @dumlj/zip-webpack-plugin -D

USAGE

import { ZipWebpackPlugin } from '@dumlj/zip-webpack-plugin'

export default {
  plugins: [
    new ZipWebpackPlugin({
      // default false
      lonely: false,
      extras: {
        '/not_import.js': '/do_import.js',
      },
    }),
  ],
}

LIVE DEMO

In the demo, the files is output to the memory, please check the console. Or remove the comment writeToDisk: true from the MemfsWebpackPlugin in webpack.config.ts and run yarn build.

INTERNAL DEPENDENCIES