Skip to content

Commit 4dd6ee7

Browse files
author
Erik Rasmussen
committed
Migrate from bundlesize to size-limit
- Remove bundlesize dependency - Add @size-limit/preset-small-lib and size-limit dependencies - Convert bundlesize config to size-limit format - Add Bundle Size Check job to CI workflow - Update GitHub Actions to v4 (checkout, setup-node) Bundle size limits: - dist/react-final-form-html5-validation.umd.min.js: 2 kB - dist/react-final-form-html5-validation.es.js: 3 kB - dist/react-final-form-html5-validation.cjs.js: 3 kB
1 parent 972f8df commit 4dd6ee7

2 files changed

Lines changed: 33 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v2
12-
- name: Use Node.js ${{ matrix.node_version }}
13-
uses: actions/setup-node@v2
11+
- uses: actions/checkout@v4
12+
- name: Use Node.js 22
13+
uses: actions/setup-node@v4
1414
with:
1515
node-version: "22"
1616
- name: Prepare env
@@ -23,9 +23,9 @@ jobs:
2323
runs-on: ubuntu-latest
2424

2525
steps:
26-
- uses: actions/checkout@v2
27-
- name: Use Node.js ${{ matrix.node_version }}
28-
uses: actions/setup-node@v2
26+
- uses: actions/checkout@v4
27+
- name: Use Node.js 22
28+
uses: actions/setup-node@v4
2929
with:
3030
node-version: "22"
3131
- name: Prepare env
@@ -38,9 +38,9 @@ jobs:
3838
runs-on: ubuntu-latest
3939

4040
steps:
41-
- uses: actions/checkout@v2
42-
- name: Use Node.js ${{ matrix.node_version }}
43-
uses: actions/setup-node@v2
41+
- uses: actions/checkout@v4
42+
- name: Use Node.js 22
43+
uses: actions/setup-node@v4
4444
with:
4545
node-version: "22"
4646
- name: Prepare env
@@ -49,3 +49,20 @@ jobs:
4949
run: yarn start test
5050
- name: Run code coverage
5151
uses: codecov/codecov-action@v2.1.0
52+
53+
size:
54+
name: Bundle Size Check
55+
runs-on: ubuntu-latest
56+
57+
steps:
58+
- uses: actions/checkout@v4
59+
- name: Use Node.js 22
60+
uses: actions/setup-node@v4
61+
with:
62+
node-version: "22"
63+
- name: Prepare env
64+
run: yarn install --ignore-scripts --frozen-lockfile
65+
- name: Build
66+
run: yarn start build
67+
- name: Check bundle size
68+
run: npx size-limit

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
"babel-core": "^7.0.0-bridge.0",
5555
"babel-eslint": "^10.1.0",
5656
"babel-jest": "^29.7.0",
57-
"bundlesize": "^0.18.2",
5857
"doctoc": "^2.2.1",
5958
"eslint": "^9.27.0",
6059
"eslint-config-react-app": "^7.0.1",
@@ -87,7 +86,9 @@
8786
"rollup-plugin-typescript2": "^0.36.0",
8887
"rollup-plugin-uglify": "^6.0.4",
8988
"ts-jest": "^29.3.4",
90-
"typescript": "^5.3.3"
89+
"typescript": "^5.3.3",
90+
"@size-limit/preset-small-lib": "^11.1.6",
91+
"size-limit": "^11.1.6"
9192
},
9293
"peerDependencies": {
9394
"final-form": ">=5.0.0",
@@ -107,18 +108,18 @@
107108
"git add"
108109
]
109110
},
110-
"bundlesize": [
111+
"size-limit": [
111112
{
112113
"path": "dist/react-final-form-html5-validation.umd.min.js",
113-
"maxSize": "2 kB"
114+
"limit": "2 kB"
114115
},
115116
{
116117
"path": "dist/react-final-form-html5-validation.es.js",
117-
"maxSize": "3 kB"
118+
"limit": "3 kB"
118119
},
119120
{
120121
"path": "dist/react-final-form-html5-validation.cjs.js",
121-
"maxSize": "3 kB"
122+
"limit": "3 kB"
122123
}
123124
],
124125
"collective": {

0 commit comments

Comments
 (0)