Skip to content

Commit d2b569c

Browse files
KyleAMathewsclaude
andauthored
Investigate Size Change action minification (#736)
feat: use minified builds for bundle size comparisons Add build:minified scripts that enable minification during builds, and configure the compressed-size-action to use these scripts. This ensures that bundle size measurements in PRs reflect actual code changes rather than being inflated by comments and whitespace, while keeping the published packages readable and unminified. Changes: - Add build:minified script to root package.json - Add build:minified scripts to @tanstack/db and @tanstack/react-db - Configure compressed-size-action to use build:minified script Co-authored-by: Claude <noreply@anthropic.com>
1 parent 979a66f commit d2b569c

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

.github/workflows/pr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ jobs:
5454
repo-token: "${{ secrets.GITHUB_TOKEN }}"
5555
pattern: "./packages/db/dist/**/*.{js,mjs}"
5656
comment-key: "db-package-size"
57+
build-script: "build:minified"
5758
- name: Compressed Size Action - React DB Package
5859
uses: preactjs/compressed-size-action@v2
5960
with:
6061
repo-token: "${{ secrets.GITHUB_TOKEN }}"
6162
pattern: "./packages/react-db/dist/**/*.{js,mjs}"
6263
comment-key: "react-db-package-size"
64+
build-script: "build:minified"
6365
build-example:
6466
name: Build Example Site
6567
runs-on: ubuntu-latest

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"type": "module",
1010
"scripts": {
1111
"build": "pnpm --filter \"./packages/**\" build",
12+
"build:minified": "pnpm --filter \"./packages/**\" build:minified",
1213
"changeset": "changeset",
1314
"changeset:publish": "changeset publish",
1415
"changeset:version": "changeset version && pnpm install --no-frozen-lockfile",

packages/db/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
],
5050
"scripts": {
5151
"build": "vite build",
52+
"build:minified": "vite build --minify",
5253
"dev": "vite build --watch",
5354
"lint": "eslint . --fix",
5455
"test": "npx vitest --run"

packages/react-db/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
},
5555
"scripts": {
5656
"build": "vite build",
57+
"build:minified": "vite build --minify",
5758
"dev": "vite build --watch",
5859
"test": "npx vitest --run",
5960
"lint": "eslint . --fix"

0 commit comments

Comments
 (0)