limit-size-webpack-plugin

1.0.5 • Public • Published

limit-size-webpack-plugin

A webpack plugin to detect your file size.

npm Version npm npm License

Install

$ npm i --save-dev limit-size-webpack-plugin

Usage

  • Add the limit-size-webpack-plugin to your webpack.config.js:
const path = require("path");
+ const { LimitSizePlugin } = require("limit-size-webpack-plugin");

module.exports = {
  entry: "./index.js",
  output: {
    path: path.resolve(__dirname, "dist"),
    filename: "bundle.js",
  },
  plugins: [
+    new LimitSizePlugin([
+      {
+        path: path.resolve(__dirname, "dist", "bundle.js"),
+        limit: "200 Kb",
+        gzip: true,
+      },
+      {
+        path: path.resolve(__dirname, "dist", "bundle.js"),
+        limit: "50 b",
+      },
+    ]),
  ],
};

License

MIT@jared.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.51latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.51
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i limit-size-webpack-plugin

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

10.2 kB

Total Files

9

Last publish

Collaborators

  • wongjorie