Skip to content

fix: copy frontend/browserslist into Docker build context#1781

Merged
gugu merged 2 commits into
mainfrom
fix/dockerfile-copy-browserslist
May 18, 2026
Merged

fix: copy frontend/browserslist into Docker build context#1781
gugu merged 2 commits into
mainfrom
fix/dockerfile-copy-browserslist

Conversation

@gugu
Copy link
Copy Markdown
Contributor

@gugu gugu commented May 18, 2026

Without this file present in /app/frontend during the production build, Angular falls back to the default browserslist (broader, older browser targets), which forces extra transpilation and inflates the initial bundle past the 5MB budget. Copying the committed browserslist preserves the intended modern targets and keeps the bundle within budget.

Summary by CodeRabbit

  • Chores
    • Updated Docker build configuration to optimize build layer caching, improving build efficiency for development and deployment pipelines.

Review Change Stack

Without this file present in /app/frontend during the production build,
Angular falls back to the default browserslist (broader, older browser
targets), which forces extra transpilation and inflates the initial
bundle past the 5MB budget. Copying the committed browserslist preserves
the intended modern targets and keeps the bundle within budget.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 18, 2026 12:08
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Warning

Rate limit exceeded

@gugu has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 49 minutes and 31 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2ccd4819-9fc1-4b70-856a-322ba8c40d30

📥 Commits

Reviewing files that changed from the base of the PR and between 7398468 and 25c698e.

📒 Files selected for processing (1)
  • Dockerfile
📝 Walkthrough

Walkthrough

The Dockerfile's front_builder stage is updated to copy frontend/browserslist into the build context alongside existing frontend dependency configuration files. This ensures the Docker layer cache invalidates when browserslist configuration changes.

Changes

Frontend build configuration

Layer / File(s) Summary
Add browserslist to Docker copy instruction
Dockerfile
The front_builder stage COPY command now includes frontend/browserslist alongside existing manifest, yarn, tsconfig, and angular config files to ensure layer cache invalidation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A browserslist, small yet keen,
Now joins the Docker build scene,
Cache will freshen when it's changed,
Browser targets all arranged,
One line makes the build more sound! 🐰

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: copying the frontend/browserslist file into the Docker build context, which directly addresses the bundle size issue mentioned in the PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Security Check ✅ Passed PR adds browserslist config file to Docker build. File is plain-text with browser queries only, non-executable, no code/secrets/injection risks. No privilege escalation or security control changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dockerfile-copy-browserslist

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ensures Angular’s production build uses the repository’s intended browser targets by including frontend/browserslist in the Docker build context, preventing fallback to Angular’s default targets that can increase transpilation and inflate bundle size.

Changes:

  • Copy frontend/browserslist into /app/frontend/ during the front_builder stage to preserve modern browser targets during production builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Without .yarnrc.yml, the container ignores yarnPath (Yarn 3.4.1) and
falls back to packageManager: yarn@1.22.22 via corepack. Yarn 1 can't
parse the Yarn berry-format yarn.lock, silently ignores --immutable,
and re-resolves dependencies from package.json. This pulled mermaid
^11.12.1 forward to 11.15.0 (vs locked 11.12.2), inflating the bundled
scripts entry by ~560 KB and pushing the initial bundle over the 5MB
budget. Copying .yarnrc.yml restores Yarn 3 and the locked resolution.

Verified: Docker initial bundle drops from 5.47 MB to 4.92 MB,
matching the local build.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gugu gugu enabled auto-merge (squash) May 18, 2026 12:19
@gugu gugu merged commit e405bb5 into main May 18, 2026
19 checks passed
@gugu gugu deleted the fix/dockerfile-copy-browserslist branch May 18, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants