Initial commit: Sproutlink short URL system
This commit is contained in:
23
web/scripts/gen-pwa-icons.mjs
Normal file
23
web/scripts/gen-pwa-icons.mjs
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Regenerate PWA icons from public/logo.png (run after logo change).
|
||||
* node scripts/gen-pwa-icons.mjs
|
||||
*/
|
||||
import sharp from 'sharp';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { dirname, join } from 'path';
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const pub = join(__dirname, '..', 'public');
|
||||
const src = join(pub, 'logo.png');
|
||||
|
||||
await sharp(src)
|
||||
.resize(192, 192, { fit: 'cover', position: 'center' })
|
||||
.png()
|
||||
.toFile(join(pub, 'pwa-192x192.png'));
|
||||
|
||||
await sharp(src)
|
||||
.resize(512, 512, { fit: 'cover', position: 'center' })
|
||||
.png()
|
||||
.toFile(join(pub, 'pwa-512x512.png'));
|
||||
|
||||
console.log('Wrote public/pwa-192x192.png, public/pwa-512x512.png');
|
||||
Reference in New Issue
Block a user