Skip to content

🎨 refactor: Prevent Font Asset Hashing in Vite Config#3865

Merged
danny-avila merged 1 commit into
mainfrom
fix/font-cache
Aug 30, 2024
Merged

🎨 refactor: Prevent Font Asset Hashing in Vite Config#3865
danny-avila merged 1 commit into
mainfrom
fix/font-cache

Conversation

@danny-avila

Copy link
Copy Markdown
Owner

Summary

  • Modified the assetFileNames function in the build.rollupOptions section of vite.config.ts.
  • Implemented a conditional statement to check for font file extensions (woff, woff2, eot, ttf, otf).
  • Set font assets to use the format 'assets/[name][extname]', preserving the original filename without a hash.
  • Maintained the existing hash-based naming convention for all other asset types.

Change Type

  • New feature (non-breaking change which adds functionality)

Testing

To test this change:

  1. Run a build of the client application using npm run build or equivalent command.
  2. Inspect the output directory, particularly the assets folder.
  3. Verify that font files are named without a hash (e.g., fontname.woff2) while other assets still include a hash.
  4. Test the application to ensure fonts are loading correctly and there are no regressions in asset loading.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • My changes do not introduce new warnings
  • Local unit tests pass with my changes

@danny-avila danny-avila merged commit 6936d00 into main Aug 30, 2024
@danny-avila danny-avila deleted the fix/font-cache branch August 30, 2024 17:56
BertKiv pushed a commit to BertKiv/LibreChat that referenced this pull request Dec 10, 2024
MichielMAnalytics pushed a commit to MichielMAnalytics/ProAI that referenced this pull request Jun 6, 2025
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