From ebe87414f28dc194d7e0412e0d1dc5de2c181192 Mon Sep 17 00:00:00 2001 From: Divyendu Singh Date: Wed, 1 Aug 2018 13:14:54 +0530 Subject: [PATCH] feat: add bundle size check to CI --- package.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a4acdea7d..e71d1685e 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,12 @@ "files": [ "dist" ], + "bundlesize": [ + { + "path": "./dist/src/index.js", + "maxSize": "15 kB" + } + ], "repository": { "type": "git", "url": "git+https://github.com/graphcool/graphql-request.git" @@ -27,12 +33,14 @@ "prepublish": "npm run build", "build": "rm -rf dist && tsc -d", "lint": "tslint --type-check --project tsconfig.json {src,test}/**/*.ts", - "test": "npm run lint && npm run build && ava --serial" + "test": "npm run lint && npm run build && ava --serial && npm run size", + "size": "bundlesize" }, "devDependencies": { "@types/fetch-mock": "5.12.2", "@types/node": "8.5.5", "ava": "0.25.0", + "bundlesize": "0.17.0", "fetch-mock": "5.13.1", "graphql-tag": "2.9.2", "tslint": "5.9.1",