linkedin / icon-magic

Automated icon build system for iOS, Android and Web
BSD 2-Clause "Simplified" License
17 stars 2 forks source link

Use puppeteer for png-to-webp conversion #6

Open ramitha opened 5 years ago

ramitha commented 5 years ago

Currently, we're using cwebp for converting png assets to webp within svg-to-raster. Puppeteer seems to have have added support to exporting webp now and we need to update this and remove the extra dependency.

oa495 commented 5 years ago

Hi @ramitha, is there a resource you can point to for the added support of webp on puppeteer? Searched through the repo and no mentions...also tried to run page.screenshot({path: 'example.webp'}) and got UnhandledPromiseRejectionWarning: Error: Unsupported screenshot mime type: image/webp so I don't believe webp is currently supported.

ramitha commented 5 years ago

@oa495 I had seen it within another npm module that uses puppeteer. It looks like there's a type: webp that you can pass in. https://github.com/etienne-martin/svg-to-img/blob/dfece31d06595f8d1273716253ba305385b45d30/src/index.ts#L78