1.0.5 • Published 3 years ago

limit-size-webpack-plugin v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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.

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago