mirror of
https://github.com/hanzoai/chat.git
synced 2026-09-30 20:51:17 +00:00
favicon.svg has been in client/public since it was added, and the web root has answered 404 for it the whole time: post-build.cjs copied three named files out of public/ and the SVG was not one of them. index.html links it first, so every tab fell back to favicon.ico — a mark that is not the one hanzo.ai serves. The copy is now the directory rather than a list, which is both less code and the reason a fourth file cannot go missing the same way. It still runs after vite, so workbox globs dist before these land and precaches none of them — which is why publicDir is off for the build in the first place. Both marks are now byte-identical to the ones hanzo.ai serves.
18 lines
572 B
JavaScript
18 lines
572 B
JavaScript
const fs = require('fs-extra');
|
|
|
|
// vite.config.ts leaves publicDir off for the build so workbox globs dist before
|
|
// these files land and does not precache them. They are copied here instead —
|
|
// the whole directory, because an enumerated list is how favicon.svg sat in
|
|
// public/ while the web root answered 404 for it.
|
|
async function postBuild() {
|
|
try {
|
|
await fs.copy('public', 'dist');
|
|
console.log('✅ public/ copied into dist/');
|
|
} catch (err) {
|
|
console.error('❌ Error copying public/ into dist/:', err);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
postBuild();
|