1
0

chore: copy monochrome files to public dev and staging folders

This commit is contained in:
userquin 2024-07-05 17:07:55 +02:00
parent cd3a47c1af
commit 469ae72c78
7 changed files with 9 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

View File

@ -1,4 +1,4 @@
import { rm, writeFile } from 'node:fs/promises' import { copyFile, rm, writeFile } from 'node:fs/promises'
import process from 'node:process' import process from 'node:process'
import { resolve } from 'pathe' import { resolve } from 'pathe'
import type { PngOptions, ResizeOptions } from 'sharp' import type { PngOptions, ResizeOptions } from 'sharp'
@ -209,6 +209,14 @@ async function generatePWAIcons(folders: string[], icons: Icons) {
apple, apple,
ico, ico,
}, svgLogo, folders[0]) }, svgLogo, folders[0])
// copy monochrome png files to public dev and staging folders
await Promise.all(folders.slice(1).map(async (folder) => {
await Promise.all(transparent.sizes.map(size => copyFile(
resolve(folders[0], `monochrome-${size}x${size}.png`),
resolve(folder, `monochrome-${size}x${size}.png`),
)))
}))
} }
console.log('Generating Elk PWA Icons...') console.log('Generating Elk PWA Icons...')