Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: revamp bundler to use optimization mode #44

Merged
merged 2 commits into from
Jun 15, 2021
Merged

Conversation

vcnc-hex
Copy link
Contributor

Image optimization should be able to convert modern format like webp if client be supported by adding the mime type to Accepts header. But, It doesn't be compressed to webp format, and the resizing and rotation functions do not work either. Internally, Next.js uses squoosh lib, but @vercel/nft couldn't include that files.
So, I just add squoosh files in the node_modules to solve the problem.

@ofhouse
Copy link
Member

ofhouse commented Jun 15, 2021

Oh nice catch, wondered why several formats could not be converted to webp before but never realized that most of the squoosh library was not added to the bundle.

Seems like the e2e tests must also be adjusted to reflect this change.
Are you able to run the tests locally or should I take a look?

@vcnc-hex
Copy link
Contributor Author

@ofhouse Sure, I can do myself to fix the snapshots applied this change for e2e tests.

Copy link
Member

@ofhouse ofhouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the contribution!
Will release this together with the upcoming Next.js version (that should be released after the Next.js Conf later today)

@ofhouse ofhouse merged commit 5b243f9 into milliHQ:main Jun 15, 2021
@ofhouse ofhouse added this to the v10.2.4 milestone Jun 15, 2021
@ofhouse
Copy link
Member

ofhouse commented Jun 15, 2021

This has now been published in the v11.0.0 release. 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants