@dumlj/zip-webpack-plugin
TypeScript icon, indicating that this package has built-in type declarations

2.5.26 • Public • Published

License: MIT  Github Repo  NPM Version  See Docs  codecov 

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

使用

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

export default {
  plugins: [
    new ZipWebpackPlugin({
      // 默认为 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

@dumlj/zip-webpack-plugin
├─┬ @dumlj/seed-webpack-plugin
│ ├─┬─ @dumlj/feature-updater
│ │ ├─── @dumlj/shell-lib
│ │ ├─── @dumlj/util-lib
│ │ └─── @dumlj/mock-libPRIVATE
│ └─── @dumlj/mock-libPRIVATE
└── @dumlj/mock-libPRIVATE

Readme

Keywords

none

Package Sidebar

Install

npm i @dumlj/zip-webpack-plugin

Weekly Downloads

373

Version

2.5.26

License

MIT

Unpacked Size

65.7 kB

Total Files

28

Last publish

Collaborators

  • cjfff
  • sexymee
  • davidjones