mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig.space.git
synced 2025-12-13 08:16:49 +00:00
15 lines
619 B
JavaScript
15 lines
619 B
JavaScript
const compress_images = require('compress-images')
|
|
const input = 'compress/*.{jpg,png,svg,gif}'
|
|
const output = 'compress/out/'
|
|
|
|
compress_images(input, output, { compress_force: true, statistic: true, autoupdate: false }, false,
|
|
{ jpg: { engine: "mozjpeg", command: ["-quality", "60"] } },
|
|
{ png: { engine: "pngquant", command: ["--quality=20-50", "-o"] } },
|
|
{ svg: { engine: "svgo", command: "--multipass" } },
|
|
{ gif: { engine: "gifsicle", command: ["--colors", "64", "--use-col=web"] } },
|
|
(error, completed, statistic) => {
|
|
if (error) console.error(error)
|
|
if (statistic) console.log(statistic)
|
|
}
|
|
)
|