1.0.1 • Published 4 years ago

@voyo/gzip-webpack-plugin v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

gzip-webpack-plugin

Gzip compress the output files.

Install

npm install @voyo/gzip-webpack-plugin --save-dev

Usage

webpack.config.js

const {GzipWebpackPlugin}=require("@voyo/gzip-webpack-plugin"); 
...
plugins:[
    //Files in all formats will be gzip compress 
    new GzipWebpackPlugin(),
    //or...
    //Only files with js,css,html suffixes are gzip compress.
    new GzipWebpackPlugin({
       extList:["js","css","html"],
       disabled:process.env.NODE_ENV!=="production"  //disabled plugin via NODE_ENV.
    })
]

Options

  • extList: string[] optional

Specify the suffix name of the file to be compressed.. All files will be compressed if not specified.

  • outputPath: string optional

  • disabled: boolean optional equiv output.path