Niels-IO/next-image-export-optimizer

process.env.nextImageExportOptimizer_storePicturesInWEBP assumed to be boolean

Closed this issue · 1 comments

On this line:
https://github.com/Niels-IO/next-image-export-optimizer/blob/master/example/src/ExportedImage.tsx#L32

The variable process.env.nextImageExportOptimizer_storePicturesInWEBP is assumed to be a boolean but it's a string. I believe that should be changed to:

const useWebp = process.env.nextImageExportOptimizer_storePicturesInWEBP === 'true';
// Or
const useWebp = process.env.nextImageExportOptimizer_storePicturesInWEBP !== 'false';

Currently it doesn't seem possible to turn off the default webp format.

Hi @andersekdahl,

Thanks for the report. That is a quite hefty bug. Glad you found it!

I created tests that should cover that case for the future.