d8ef59e370
Estrazione da Web Insanity.fig, identificazione visiva, mappatura semantica e ottimizzazione peso. 31 immagini in src/assets/img/, 2 loghi InsanityLab (fallback da Dati/) in public/img/. Tutti i 4 partner logo trovati nel Figma. PNG foto convertite a JPG q85 per ridurre da 99 MB a 3.4 MB totali. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
20 lines
840 B
JavaScript
20 lines
840 B
JavaScript
import { copyFileSync, mkdirSync, existsSync } from 'node:fs';
|
|
import { readFileSync } from 'node:fs';
|
|
import { join, dirname } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const root = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
const map = JSON.parse(readFileSync(join(root, 'scripts/asset-map.json'), 'utf8'));
|
|
let n = 0, missing = 0;
|
|
for (const [destDir, entries] of Object.entries(map)) {
|
|
mkdirSync(join(root, destDir), { recursive: true });
|
|
for (const [src, dest] of Object.entries(entries)) {
|
|
const from = join(root, 'assets-src', src);
|
|
if (!existsSync(from)) { console.error(`MANCANTE: ${src}`); missing++; continue; }
|
|
copyFileSync(from, join(root, destDir, dest));
|
|
n++;
|
|
}
|
|
}
|
|
console.log(`Copiate ${n} immagini${missing ? `, ${missing} mancanti` : ''}`);
|
|
process.exit(missing ? 1 : 0);
|