Skip to content

Commit

Permalink
chore: add size-limit.yml workflow (#6573)
Browse files Browse the repository at this point in the history
chore: size-limit
  • Loading branch information
guoyunhe authored Mar 15, 2024
1 parent 1d0fc6f commit 937f845
Show file tree
Hide file tree
Showing 3 changed files with 723 additions and 6 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/size-limit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 📦 Size Limit

on:
pull_request:
types: [opened, synchronize]

permissions:
contents: read

jobs:
size:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- name: size-limit
uses: ant-design/size-limit-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
package_manager: pnpm
env:
NODE_OPTIONS: '--max_old_space_size=4096'
PRODUCTION_ONLY: 1
NO_DUP_CHECK: 1
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"package-diff": "antd-tools run package-diff --path=./lib",
"pub": "npm run package-diff && npm publish ./lib",
"pub:alpha": "npm publish ./lib --tag alpha",
"pub:dev": "npm publish ./lib --tag dev"
"pub:dev": "npm publish ./lib --tag dev",
"size-limit": "size-limit",
"size-limit:ci": "size-limit --json"
},
"dependencies": {
"@floating-ui/dom": "^1.4.2",
Expand Down Expand Up @@ -51,6 +53,7 @@
"@docsearch/react": "^3.3.3",
"@jest/types": "^28.1.3",
"@react-spring/core": "~9.6.1",
"@size-limit/preset-big-lib": "^11.1.0",
"@statoscope/webpack-plugin": "^5.26.2",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
Expand Down Expand Up @@ -116,6 +119,7 @@
"react-lottie": "^1.2.3",
"react-test-renderer": "^18.2.0",
"react-virtualized": "^9.22.5",
"size-limit": "^11.1.0",
"style-loader": "^3.3.2",
"through2": "^4.0.2",
"ts-jest": "^28.0.8",
Expand Down Expand Up @@ -158,5 +162,11 @@
"url": "git+https://github.com/ant-design/ant-design-mobile.git",
"branch": "master",
"platform": "github"
}
},
"size-limit": [
{
"path": "./lib/bundle/antd-mobile.es.js",
"limit": "200 kB"
}
]
}
Loading

0 comments on commit 937f845

Please sign in to comment.