mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-01 03:26:18 +00:00
* 🖼️ fix: Precache PWA Icons and Let Them Refresh Production builds set `publicDir: false`, so `client/scripts/post-build.cjs` copied `public/assets` into `dist/assets` only after `vite build` had finished. vite-plugin-pwa globs `dist/` from its `closeBundle` hook, inside that build, so the icon patterns in `workbox.globPatterns` matched zero files and the generated `sw.js` shipped without a single icon, silently: workbox treats an empty glob as a no-op. `build:ci`, used by the Playwright lanes, never ran the post-build step at all and produced a `dist` with no icons or `robots.txt`. Move the copy into a `copyPublicAssets()` build plugin that runs in `writeBundle`, which completes for every plugin before `closeBundle`, and drop the post-build script with its lone `fs-extra` dependency. Ordering alone was not enough. The plugin defaults `dontCacheBustURLsMatching` to `/^assets\//`, true only for hashed bundle output. The icons live in `assets/` under stable filenames, so they entered the manifest with `revision: null`, permanently immutable, meaning an installed PWA would never pick up a rebranded icon: the other half of the report. Match Vite's `[name].[hash].[ext]` shape instead so hashed chunks stay revision-free while the icons carry content revisions. Also drop `manifest.webmanifest` from `globPatterns`, since the plugin always appends it as an additional manifest entry and globbing it duplicated the precache entry. A clean `npm run build` now yields 55 precache entries with all five icons revisioned, against 0 icon entries before. * 📝 docs: Describe the Full Copy Set in copyPublicAssets * 🔒 chore: Drop fs-extra From bun.lock |
||
|---|---|---|
| .. | ||
| ISSUE_TEMPLATE | ||
| scripts | ||
| workflows | ||
| CODE_OF_CONDUCT.md | ||
| configuration-release.json | ||
| configuration-unreleased.json | ||
| CONTRIBUTING.md | ||
| FUNDING.yml | ||
| playwright.yml | ||
| pull_request_template.md | ||
| SECURITY.md | ||