fix(ipx): use the configured baseURL when prerendering static images - #2313
fix(ipx): use the configured baseURL when prerendering static images#2313chairulakmal wants to merge 1 commit into
Conversation
commit: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe change passes the configured IPX runtime Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This localized change uses the configured base URL for static image prerendering while preserving the default behavior, and no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2313 +/- ##
==========================================
- Coverage 32.61% 32.35% -0.27%
==========================================
Files 7 7
Lines 371 374 +3
Branches 131 132 +1
==========================================
Hits 121 121
- Misses 194 196 +2
- Partials 56 57 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🔗 Linked issue
resolves #1394
📚 Description
Prerendering skips every IPX image when you set a custom
baseURL, because the filter inprerenderStaticImageshardcodes/_ipx/. I changed it to use the configured base URL and fall back to/_ipx, so nothing changes on the default. I also strip a trailing slash, since'/static-images/'would otherwise fail the same silent way.I pass the base URL in from the three call sites, which all have it already, instead of reading it inside the util: the unit tests import
src/runtime/utils/too, and#importsdoes not resolve there. Also added a new test file,test/e2e/generate-base-url.test.ts, instead of editing the existing generate test, so the default path stays covered. It fails without the change.The CI tests passed except the two
aliyune2e cases that time out for me locally because their host is unreachable from my network. This is the same as a cleanmain, so unlikely the result of my changes in this PR.