Skip to content

Commit f41f7cc

Browse files
committed
chore: add build analysis option and integrate size-limit action
1 parent 8a7e5c3 commit f41f7cc

File tree

4 files changed

+687
-24
lines changed

4 files changed

+687
-24
lines changed

.github/workflows/test.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ jobs:
3737
- name: Eslint check
3838
run: pnpm lint
3939

40+
- name: Build check
41+
if: github.event_name == 'push'
42+
run: pnpm build
43+
44+
- name: Bundle check
45+
if: github.event_name == 'pull_request'
46+
uses: andresz1/size-limit-action@v1
47+
env:
48+
ANALYZE: true
49+
with:
50+
github_token: ${{ secrets.GITHUB_TOKEN }}
51+
skip_step: install
52+
4053
unit_test:
4154
name: Unit test
4255
runs-on: ubuntu-latest

package.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
"prepare": "simple-git-hooks",
1212
"dev": "vite --port 4173",
1313
"build": "vite build",
14+
"build:analyze": "cross-env ANALYZE=1 vite build && size-limit",
1415
"serve": "vite preview --port 4173",
1516
"type-check": "vue-tsc --noEmit",
1617
"lint": "eslint --fix .",
1718
"test": "pnpm test:unit && pnpm test:e2e && tsx scripts/merge-coverage.ts",
18-
"test:e2e": "cross-env NODE_ENV=testing pnpm build && cross-env CI=true playwright test",
19+
"test:e2e": "pnpm build && cross-env CI=true playwright test",
1920
"test:e2e:prod": "cross-env E2E_BASE_URL='https://vue3-realworld-example-app-mutoe.vercel.app' playwright test",
2021
"test:e2e:ui": "playwright test --ui",
2122
"test:e2e:ui:debug": "playwright test --ui --headed --debug",
@@ -33,20 +34,22 @@
3334
"@mutoe/eslint-config": "^4.11.0-2",
3435
"@pinia/testing": "^1.0.2",
3536
"@playwright/test": "1.55.1",
37+
"@size-limit/preset-app": "^11.2.0",
3638
"@testing-library/user-event": "^14.6.1",
3739
"@testing-library/vue": "^8.1.0",
3840
"@types/node": "^24.5.2",
3941
"@vitejs/plugin-vue": "^6.0.1",
4042
"@vitest/coverage-v8": "^3.2.4",
41-
"cross-env": "^7.0.3",
43+
"cross-env": "^10.0.0",
4244
"eslint": "^9.36.0",
4345
"eslint-plugin-vuejs-accessibility": "^2.4.1",
4446
"happy-dom": "^18.0.1",
45-
"lint-staged": "^16.2.0",
47+
"lint-staged": "^16.2.1",
4648
"monocart-coverage-reports": "^2.12.9",
4749
"msw": "^2.11.3",
4850
"rollup-plugin-analyzer": "^4.0.0",
4951
"simple-git-hooks": "^2.13.1",
52+
"size-limit": "^11.2.0",
5053
"swagger-typescript-api": "^13.2.13",
5154
"tsx": "^4.20.6",
5255
"typescript": "~5.9.2",
@@ -62,5 +65,10 @@
6265
},
6366
"lint-staged": {
6467
"*": "eslint --fix"
65-
}
68+
},
69+
"size-limit": [
70+
{
71+
"path": "dist/**/*.js"
72+
}
73+
]
6674
}

0 commit comments

Comments
 (0)