15 lines
387 B
TypeScript
15 lines
387 B
TypeScript
import { Jimp } from 'jimp'
|
|
|
|
export default async () => {
|
|
const inputSrc = 'src/assets/images/logo.png'
|
|
const favicon = 'public/favicon.png'
|
|
|
|
try {
|
|
const image = await Jimp.read(inputSrc)
|
|
image.resize({ w: 90 })
|
|
await image.write(favicon)
|
|
console.log('Favicon generated successfully')
|
|
} catch (error) {
|
|
console.error('Error generating favicon:', error)
|
|
}
|
|
}
|