feat(next/image): remove `sharp` for wasm variant (#22253)
This pull request removes the native `sharp` dependency (which doesn't work on some Linux variants, nor **M1 Mac**) and replaces it with a wasm equivalent. It also reduces Next.js' installed size by 27.3 MB. The code is adapted from the [Squoosh CLI](https://github.com/GoogleChromeLabs/squoosh). This PR still supports: - Rotation normalization - Resizing - PNG - JPEG - Webp However, it (temporarily) removes support for: - Resizing Gifs - Resizing Tiff (these formats still get served and rendered correctly by the image component) --- Fixes #20456 Closes #20738 Closes #21762
Showing
| ... | ... | @@ -91,6 +91,7 @@ |
| "get-port": "5.1.1", | ||
| "glob": "7.1.6", | ||
| "gzip-size": "5.1.1", | ||
| "image-size": "0.9.3", | ||
| "is-animated": "2.0.0", | ||
| "isomorphic-unfetch": "3.0.0", | ||
| "jest-circus": "26.0.1", | ||
| ... | ... |
This source diff could not be displayed because it is too large.
You can
view the blob
instead.
This diff is collapsed.
This diff is collapsed.
File added
This diff is collapsed.
File added
File added
File added
File added
File added
This diff is collapsed.
File added
This diff is collapsed.
File added
This diff is collapsed.
Please
register
or
sign in
to comment