mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
refactor: implement scalable asset manifest system for dynamic images
Created build-time script to generate TypeScript manifest from public/assets, avoiding import.meta.glob limitations. Images stay in public/ for scalability (supports hundreds), while components get type-safe auto-discovery. Manifest auto-regenerates before builds.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
# Generated Files
|
||||
|
||||
This directory contains auto-generated TypeScript files. Do not edit these files manually.
|
||||
|
||||
## asset-manifest.ts
|
||||
|
||||
Auto-generated manifest of all banner and not-found images from `public/assets/`.
|
||||
|
||||
**To regenerate:**
|
||||
```bash
|
||||
yarn generate:assets
|
||||
```
|
||||
|
||||
**Auto-regenerated:**
|
||||
- Before every build (`yarn build`)
|
||||
- Before dev server start (`yarn start`)
|
||||
|
||||
**To add new banners:**
|
||||
1. Add files to `public/assets/banners/` following the pattern `banner-*.{jpg,jpeg,gif,png}`
|
||||
2. Run `yarn generate:assets` (or it will auto-run on next build/start)
|
||||
|
||||
**To add new not-found images:**
|
||||
1. Add files to `public/assets/not-found/` following the pattern `not-found-*.{jpg,jpeg,gif,png}`
|
||||
2. Run `yarn generate:assets` (or it will auto-run on next build/start)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// Auto-generated file - do not edit manually
|
||||
// Run 'node scripts/generate-asset-manifest.js' to regenerate
|
||||
// This file is generated from public/assets/ directory
|
||||
|
||||
export const BANNERS = [
|
||||
'assets/banners/banner-1.jpg',
|
||||
'assets/banners/banner-2.jpg',
|
||||
'assets/banners/banner-3.gif',
|
||||
'assets/banners/banner-4.gif',
|
||||
'assets/banners/banner-5.png',
|
||||
] as const;
|
||||
|
||||
export const NOT_FOUND_IMAGES = ['assets/not-found/not-found-1.png'] as const;
|
||||
Reference in New Issue
Block a user