optimized-images-loader
optimized-images-loader copied to clipboard
Add an opt in option to use imagemin instead of wasm libs
Trying to fix https://github.com/cyrilwanner/next-optimized-images/issues/195 i ended up patching the loader to use image-min so i can build the images, so i was thinking maybe we could add an opt in option to use system libs instead of wasm, it should be a little bit faster and it can use as much memory as the system has. I am willing to make a PR, but i wanted to check in with you first to discuss about the configuration structure. When i have time i'll make a proposal :).
Since you are talking about memory problems I guess you had the same RangeError: WebAssembly.Memory(): could not allocate memory
?
Would be really happy to see your proposal :)
@andreisergiu98 Do you mind sharing your solution? I am stuck. My prod used to work with the previous version (though slow). When I migrated to canary v10, my 2G RAM VPS is not able to build site that has only 4 images! Now I am stuck and I don't want to roll back. BTW, works perfectly fine on my laptop with plenty of RAM.
@semyou I cloned this repository and replaced wasm-codecs from src/optimize/jpeg.ts and src/optimize/png.ts with imagemin (with mozjpeg and pngquant plugins), then i added it into the project as a yarn workspace. I think yarn resolution would also work.
Also need a solution for RangeError: WebAssembly.Memory(): could not allocate memory
, subscribing.