Skip to content

fix(deploy): configure base path and assets for subdirectory deployment#3

Merged
LuisMLGDev merged 2 commits into
mainfrom
fix(deploy)--configure-base-path-and-assets-for-subdirectory-deployment
Dec 26, 2025
Merged

fix(deploy): configure base path and assets for subdirectory deployment#3
LuisMLGDev merged 2 commits into
mainfrom
fix(deploy)--configure-base-path-and-assets-for-subdirectory-deployment

Conversation

@LuisMLGDev

Copy link
Copy Markdown
Owner

🎯 Purpose

Fixes the white screen issue and broken images when deploying the application to GitHub Pages in a subdirectory (/test-abb/).

🛠️ Changes

1. Routing Configuration

  • Vite: Set base to /test-abb/ in vite.config.ts to ensure assets are served from the correct relative path.
  • React Router: Added basename="/test-abb" to BrowserRouter in main.tsx so client-side routing respects the subdirectory.

2. Asset Management

  • Image Paths: Moved static images (banner.jpg, hero.png, etc.) from public/ to src/assets/.
  • Imports: Refactored components (Banner, Cart, HeroSection) to import images directly. This allows Vite to process them and generate correct hashed URLs during build, resolving the 404 errors on production.

✅ Verification

  • Verified locally with yarn build + yarn preview, confirming that the application loads correctly at http://localhost:xxxx/test-abb/ and images are visible.

@LuisMLGDev LuisMLGDev merged commit 5407dab into main Dec 26, 2025
3 checks passed
@LuisMLGDev LuisMLGDev deleted the fix(deploy)--configure-base-path-and-assets-for-subdirectory-deployment branch December 26, 2025 17:16
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.

1 participant