wcz-layout
Version:
9 lines (7 loc) • 1.18 kB
Markdown
# Favicon Generation
1. Ask the user for the absolute filesystem path to their app logo. Recommend a square PNG, JPG, BMP, or WEBP image at least 512 x 512 pixels, but continue with a smaller image when the user provides one.
2. Verify that the supplied path exists and is an image file.
3. Check whether `favicons` is installed globally. If it is missing, run `npm install --global favicons`. Do not add it to this project's dependencies.
4. Set `NODE_PATH` to the result of `npm root --global` and use a temporary CommonJS Node script to call `favicons(sourcePath, options)`. Enable Android and favicon output, enable Apple output with `background: "transparent"`, and disable Apple startup, Windows, and Yandex assets. Write the returned `images` and `files` entries to `/public`.
5. Keep only the existing favicon assets that the template owns: `android-chrome-192x192.png`, `android-chrome-512x512.png`, `apple-touch-icon.png`, `favicon-16x16.png`, `favicon-32x32.png`, and `favicon.ico`. Delete any additional generated assets and the temporary script. Leave unrelated public assets unchanged.
6. Verify that all six favicon assets exist, then report completion to the user.