fix: add .env.production to bake correct /xm-player/ base path into builds#255
Conversation
…base path Without VITE_APP_BASE_PATH set at build time, import.meta.env.BASE_URL bakes in as "/" instead of "/xm-player/", causing all asset requests (shaders, worklets, mod files) to 404 on the subdirectory deployment. https://claude.ai/code/session_0139136nD9YdA7A578NW1ZsC
|
Lost in the diff? Review this PR in Change Stack to follow the change map from intent to exact ranges. Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesProduction Base Path Configuration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~1 minute Poem
✨ 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 |
Summary
.env.productionwithVITE_APP_BASE_PATH=/xm-player/npm run build, soimport.meta.env.BASE_URLis correctly baked in as/xm-player/without needing to manually prefix the env var every timeBASE_URLdefaults to/, causing all asset fetches (shaders, worklets,.modfiles) to 404 on the subdirectory deployment attest.1ink.us/xm-player/Root cause
The build was run as plain
npm run buildinstead ofVITE_APP_BASE_PATH=/xm-player/ npm run build. Thedeploy.pyscript documents the correct command but it was easy to miss. This commit makes the correct base path automatic for all production builds.Test plan
npm run build(no env prefix needed now)/xm-player/asset paths.modload without 404shttps://claude.ai/code/session_0139136nD9YdA7A578NW1ZsC
Generated by Claude Code
Summary by CodeRabbit