@vitus-labs/tools-favicon
v2.8.0
Published
CLI tool for generating multi-platform favicons from a source image.
Readme
@vitus-labs/tools-favicon
CLI tool for generating multi-platform favicons from a source image.
Powered by favicons.
Installation
bun add -d @vitus-labs/tools-faviconUsage
Add to your package.json:
{
"scripts": {
"favicon": "vl_favicon"
}
}Configuration
Configure via vl-tools.config.mjs (key: favicon):
export default {
favicon: {
background: '#fff',
theme_color: '#fff',
icons: [
{
input: 'src/assets/logo.png',
output: 'public/icons',
path: '/icons',
},
],
},
}Options
| Option | Default | Description |
|---|---|---|
| background | #fff | Background color for icons |
| theme_color | #fff | Theme color for manifests |
| display | standalone | PWA display mode |
| orientation | any | Screen orientation |
| lang | en-US | Language tag |
| start_url | /?homescreen=1 | PWA start URL |
| path | / | Base public URL path of the generated files |
| icons | [] | Array of { input, output, path } entries (input/output relative to cwd or absolute; path is appended to the base path). Output directories are created if missing. |
| platforms | all enabled | Per-platform toggles passed to favicons as its icons option, e.g. { appleStartup: false } |
iconsused to hold the platform toggles object; that shape is still accepted but deprecated - move it toplatforms.
Generated platforms
Android, Apple icon, Apple startup, Coast, Favicons, Firefox, Windows, Yandex.
Programmatic API
import { generateFavicons } from '@vitus-labs/tools-favicon'
await generateFavicons()License
MIT
