Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(frontend): add bundlesize check for frontend #163

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,25 @@ jobs:
run: pnpm install
- name: Check for vulnerable dependencies
run: pnpm run security
check-bundle-size:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./examples/bifrost-starter
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 8.6.4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Check bundlesize
working-directory: ./examples/bifrost-starter/apps/frontend
run: pnpm build:analyze:bundlesize
19 changes: 19 additions & 0 deletions examples/bifrost-starter/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,22 @@ jobs:
run: pnpm install
- name: Check for vulnerable dependencies
run: pnpm run security
check-bundle-size:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 8.6.4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Check bundlesize
working-directory: ./apps/frontend
run: pnpm build:analyze:bundlesize
12 changes: 12 additions & 0 deletions examples/bifrost-starter/apps/frontend/bundlesize.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"files": [
{
"path": "./.next/server/chunks/*.js",
"maxSize": "200 kB"
},
{
"path": "./.next/static/chunks/*.js",
"maxSize": "200 kB"
}
]
}
2 changes: 2 additions & 0 deletions examples/bifrost-starter/apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {
"build": "next build",
"build:analyze": "DEV_ANALYZE_BUNDLE=true next build",
"build:analyze:bundlesize": "cd ../.. && pnpm build --filter=@bifrost-starter/frontend && cd - && bundlesize",
"dev": "./gen_env.sh local && next dev -p 3000",
"lint": "eslint --cache --cache-location .next/cache/eslint/ './**/*.{js,ts,tsx}'",
"lint:fix": "pnpm lint --fix",
Expand Down Expand Up @@ -40,6 +41,7 @@
"@types/node": "17.0.25",
"@types/react": "18.2.14",
"@types/react-dom": "18.2.6",
"bundlesize2": "0.0.31",
"dependency-cruiser": "11.15.0",
"dependency-cruiser-config-custom": "workspace:*",
"eslint-config-custom": "workspace:*",
Expand Down
Loading