# gzip-webpack-plugin

> webpack gz plugin

Latest version **1.1.3** (published 2020-04-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install gzip-webpack-plugin
pnpm add gzip-webpack-plugin
yarn add gzip-webpack-plugin
bun add gzip-webpack-plugin
```

Provides the command `gzip-webpack-plugin`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2020-04-23 |
| First published | 2019-07-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 8 |
| Dependencies | 3 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | fengzaiku |
| Maintainers | fengzaiku |
| Keywords | webpack, gzip, gz, compress |

## Links

- npm: https://www.npmjs.com/package/gzip-webpack-plugin
- Repository: https://github.com/fengzaiku/gzip-webpack-plugin
- Homepage: https://github.com/fengzaiku/gzip-webpack-plugin/blob/master/README.md
- Issues: https://github.com/fengzaiku/gzip-webpack-plugin/issues
- npm.io page: https://npm.io/package/gzip-webpack-plugin

## Dependencies (3)

- [tar-stream](https://npm.io/package/tar-stream.md) ^2.1.0
- [concat-stream](https://npm.io/package/concat-stream.md) ^2.0.0
- [webpack-sources](https://npm.io/package/webpack-sources.md) ^1.3.0

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 1.1.3 (latest) — 2020-04-23
- 1.1.2 — 2019-08-05
- 1.1.1 — 2019-08-02
- 1.1.0 — 2019-08-02
- 1.0.0 — 2019-07-14

## README

# gzip-webpack-plugin
    webpack tar.gz文件/文件夹压缩插件

## Installation
    Webpack >=4.0:

    npm install --save-dev gzip-webpack-plugin

## Usage
    webpack.config.js
```javascript
    const GzipWebpackPlugin = require('gzip-webpack-plugin');

    module.exports = {
      // ...
      plugins: [
        new GzipWebpackPlugin({
          // 压缩文件打包起始路径，默认process.cwd()
          root: process.cwd(),
          
          // 压缩文件输出路径，默认process.cwd()
          outPath: process.cwd(),
    
          // 压缩文件输出名字，默认为webpack输出目录名称
          filename: 'my_app',
    
          // 压缩文件扩展名，默认是.tar.gz
          extension: '.gzip',
          
          // 是否删除源文件, 默认为true    
          delSource: true,
          
          // 输入需要压缩文件/文件夹名称正则、字符串或数组名称。默认会压缩webpack输出目录下得所有文件
          include: [/\.js/],
    
          // 不需要压缩的文件夹名称，配置同include
          exclude: [/\.css/],
          
          // 详细可查看:http://nodejs.cn/api/zlib.html#zlib_class_options
          zlibOptions: {
            // ...
          },
        })
      ]
    };
```

## Example

````javascript
    const path = require('path');
    const GzipWebpackPlugin = require('gzip-webpack-plugin');
   
    module.exports = {
        mode: "development",
        entry: path.join(__dirname, 'test.js'),
        output: {
            path: path.resolve(__dirname,'dist'),
            filename: "bundle.js"
        },
        plugins: [
            new GzipWebpackPlugin(),
        ]
    };
````

---
_Source: https://npm.io/package/gzip-webpack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
