import sharp from 'sharp'; import { mkdirSync } from 'fs'; const BRAND = '#c67139'; const MARK = '#fff8ee'; function svgIcon({ size, markScale }) { const r = (316 / 2) * markScale; const cx = size / 2; const cy = size / 2; const scale = (size * markScale) / 316; return ` `; } mkdirSync('public/icons', { recursive: true }); const targets = [ { file: 'public/icons/apple-touch-icon.png', size: 180, markScale: 0.68 }, { file: 'public/icons/apple-touch-icon-152.png', size: 152, markScale: 0.68 }, { file: 'public/icons/apple-touch-icon-167.png', size: 167, markScale: 0.68 }, { file: 'public/icons/icon-192.png', size: 192, markScale: 0.68 }, { file: 'public/icons/icon-512.png', size: 512, markScale: 0.68 }, { file: 'public/icons/icon-maskable-512.png', size: 512, markScale: 0.55 }, ]; for (const t of targets) { await sharp(Buffer.from(svgIcon(t))) .png() .toFile(t.file); console.log(`wrote ${t.file}`); }