file-size-check-plugin

0.1.0 • Public • Published

file-size-check-plugin

npm

A Webpack plugin to check file (js|css) size after build by webpack and gzip compress.

Installation:

Using npm:

$ npm install compression-webpack-plugin file-size-check-plugin --save-dev 

Example:

⚠️ Need to use compression-webpack-plugin, Because file-size-check-plugin check the file end with .gz

⚠️ If you don't set the 'fileSizeLimit' params, it will be set at 300 * 1024 by default.

const CompressionWebpackPlugin = require('compression-webpack-plugin');
const FileSizeCheck = require('file-size-check-plugin');

webpackConfig = {
  plugins: [
    new CompressionWebpackPlugin({
      test: /\.(js|css)(\?.*)?$/i
    }),
    new FileSizeCheck({ 
      fileSizeLimit: 300 * 1024
    })
  ]
};

License

MIT (http://www.opensource.org/licenses/mit-license.php)

Readme

Keywords

Package Sidebar

Install

npm i file-size-check-plugin

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

2.61 kB

Total Files

3

Last publish

Collaborators

  • henryxie2093