diff --git a/.circleci/config.yml b/.circleci/config.yml index 7c2e4e6226..cce423e6ec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2 references: container_config: &container_config docker: - - image: circleci/node:8 + - image: circleci/node:10 working_directory: ~/ant-design attach_workspace: &attach_workspace @@ -97,6 +97,7 @@ jobs: - *attach_workspace - run: npm run dist - run: node ./tests/dekko/dist.test.js + - run: npm run bundlesize - persist_to_workspace: root: ~/ant-design paths: diff --git a/package.json b/package.json index 701910655f..96bfcd814f 100644 --- a/package.json +++ b/package.json @@ -117,6 +117,7 @@ "bisheng-plugin-description": "^0.1.4", "bisheng-plugin-react": "^1.0.0", "bisheng-plugin-toc": "^0.4.4", + "bundlesize": "^0.18.0", "chalk": "^2.4.2", "cross-env": "^5.2.0", "css-split-webpack-plugin": "^0.2.6", @@ -211,6 +212,7 @@ "sort-api": "antd-tools run sort-api-table", "api-collection": "antd-tools run api-collection", "dist": "antd-tools run dist", + "bundlesize": "bundlesize", "compile": "antd-tools run compile", "tsc": "tsc", "start": "rimraf _site && mkdir _site && node ./scripts/generateColorLess.js && cross-env NODE_ENV=development bisheng start -c ./site/bisheng.config.js", @@ -242,5 +244,12 @@ "Firefox ESR", "> 1%", "ie >= 9" - ] + ], + "bundlesize": [{ + "path": "./dist/antd.min.js", + "maxSize": "540 kB" + }, { + "path": "./dist/antd.min.css", + "maxSize": "60 kB" + }] } diff --git a/scripts/test-all.sh b/scripts/test-all.sh index 33c1780fb9..eceb6ac81e 100755 --- a/scripts/test-all.sh +++ b/scripts/test-all.sh @@ -2,6 +2,7 @@ npm run lint && \ npm run dist && \ +npm run bundlesize && \ node ./tests/dekko/dist.test.js && \ LIB_DIR=dist npm test && \ npm run compile && \