fix: copy frontend/browserslist into Docker build context#1781
Conversation
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>
|
Warning Rate limit exceeded
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 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. 📝 WalkthroughWalkthroughThe Dockerfile's ChangesFrontend build configuration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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/browserslistinto/app/frontend/during thefront_builderstage 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>
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