diff --git a/package.json b/package.json index 10833dfbc..e28ae3d5c 100644 --- a/package.json +++ b/package.json @@ -76,8 +76,9 @@ "babel-preset-stage-3": "6.24.1", "babel-register": "6.26.0", "babel-runtime": "6.26.0", + "bundlesize": "0.17.0", + "cross-env": "5.1.4", "codecov": "3.0.4", - "cross-env": "5.2.0", "css-loader": "0.28.10", "element-react": "1.4.8", "element-theme-default": "1.4.13", @@ -152,13 +153,14 @@ "scripts": { "release": "standard-version -a -s", "prepublish": "in-publish && npm run build:webui && npm run code:build || not-in-publish", - "flow": "flow", + "flow": "flow check", "pretest": "npm run code:build", "test": "npm run test:unit", "test:unit": "cross-env NODE_ENV=test BABEL_ENV=test TZ=UTC jest --config ./jest.config.js --maxWorkers 2", "test:functional": "cross-env NODE_ENV=testOldEnv jest --config ./test/jest.config.functional.js --testPathPattern ./test/functional/index*", "test:e2e": "cross-env BABEL_ENV=testOldEnv jest --config ./test/jest.config.e2e.js", - "test:all": "npm run build:webui && npm run test && npm run test:functional && npm run test:e2e", + "test:size": "bundlesize", + "test:all": "npm run build:webui && npm run test && npm run test:functional && npm run test:e2e && npm run test:size", "pre:ci": "npm run lint && npm run build:webui", "commitmsg": "commitlint -e $GIT_PARAMS", "coverage:publish": "codecov", @@ -186,6 +188,28 @@ "pre-commit": "npm run lint" } }, + "bundlesize": [ + { + "path": "./static/vendor*.js", + "maxSize": "200 kB" + }, + { + "path": "./static/[0-9].*.js", + "maxSize": "20 kB" + }, + { + "path": "./static/[1-9].*.css", + "maxSize": "2.1 kB" + }, + { + "path": "./static/0.*.css", + "maxSize": "45 kB" + }, + { + "path": "./build/**/*.js", + "maxSize": "5.50 kB" + } + ], "license": "MIT", "commitlint": { "extends": [ diff --git a/yarn.lock b/yarn.lock index e444e0ae5..7610161db 100644 Binary files a/yarn.lock and b/yarn.lock differ