bonpoint/web/scripts/generate-icons.js
jmartin c4ebb5b2d8 Initialise le dépôt Bonpoint avec docs et prototype web.
Structure docs/, web/ (app Node existante) et mobile/ (placeholder Flutter).
2026-06-12 11:39:51 +02:00

18 lines
523 B
JavaScript

const path = require('path');
const sharp = require('sharp');
const svgPath = path.join(__dirname, '..', 'public', 'icons', 'icon.svg');
const outDir = path.join(__dirname, '..', 'public', 'icons');
const sizes = [180, 192, 512];
Promise.all(sizes.map((size) => sharp(svgPath)
.resize(size, size)
.png()
.toFile(path.join(outDir, size === 180 ? 'apple-touch-icon.png' : `icon-${size}.png`))))
.then(() => console.log('Icônes générées'))
.catch((err) => {
console.error(err);
process.exit(1);
});