file-size-check-plugin
v0.1.0
Published
Webpack plugin that check the file size after build.
Downloads
4
Readme
file-size-check-plugin
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)