From 394cb5c1a2b77e069135f811ae1cc051e5881ec2 Mon Sep 17 00:00:00 2001
From: Jack Reed <phillipjreed@gmail.com>
Date: Thu, 4 Apr 2019 08:06:58 -0600
Subject: [PATCH] replace size-limit with bundlesize for CI goodness

---
 bundlewatch.config.json |  8 ++++++++
 package.json            | 10 ++--------
 2 files changed, 10 insertions(+), 8 deletions(-)
 create mode 100644 bundlewatch.config.json

diff --git a/bundlewatch.config.json b/bundlewatch.config.json
new file mode 100644
index 000000000..f3731d0fd
--- /dev/null
+++ b/bundlewatch.config.json
@@ -0,0 +1,8 @@
+{
+  "files": [
+    {
+      "path": "dist/mirador.min.js",
+      "maxSize": "420 KB"
+    }
+  ]
+}
diff --git a/package.json b/package.json
index 7e3d3f714..203844491 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,7 @@
     "build:es": "mkdir -p dist/es && cp -r src dist/es && babel dist/es -d dist/es",
     "build:watch": "webpack --watch --mode=development",
     "prepublishOnly": "npm run clean && npm run build:es && npm run build",
-    "size": "size-limit",
+    "size": "bundlewatch --config bundlewatch.config.json",
     "start": "npm run build:dev && concurrently \"npm run build:watch\" \"npm run server -- -p 4444\"",
     "server:json": "node ./scripts/json-server/server.js >> ./scripts/json-server/json-server.log"
   },
@@ -27,12 +27,6 @@
     "Jack Reed <phillipjreed@gmail.com> (https://www.jack-reed.com)"
   ],
   "repository": "https://github.com/ProjectMirador/mirador",
-  "size-limit": [
-    {
-      "limit": "390 KB",
-      "path": "dist/mirador.min.js"
-    }
-  ],
   "dependencies": {
     "@material-ui/core": "^3.9.1",
     "@material-ui/icons": "^3.0.2",
@@ -76,6 +70,7 @@
     "babel-eslint": "10.0.1",
     "babel-jest": "^24.5.0",
     "babel-loader": "^8.0.4",
+    "bundlewatch": "^0.2.1",
     "chalk": "^2.4.2",
     "codecov": "^3.1.0",
     "concurrently": "^4.0.1",
@@ -104,7 +99,6 @@
     "react-dom": "^16.8.3",
     "redux-mock-store": "^1.5.1",
     "sass-lint": "^1.12.1",
-    "size-limit": "^0.21.1",
     "style-loader": "^0.23.1",
     "supertest": "^4.0.2",
     "terser-webpack-plugin": "^1.2.1",
-- 
GitLab