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(deps): bump image-minimizer-webpack-plugin to v3 #867

Merged
merged 5 commits into from
Dec 22, 2021

Conversation

kellymears
Copy link
Member

@kellymears kellymears commented Dec 21, 2021

Type of change

  • MINOR: feature

Dependencies added

  • @squoosh/lib

Details

  • fix: imagemin-webpack-plugin v3
  • improve: swap out imagemin implementation for @squoosh/lib
  • docs: update with new api

Benefits

  • Squoosh squishes just about errything.
  • It's less of a burden to manage the peer dependencies.
  • It's faster to install in CI.
  • this snapshot diff basically: -76.6 KB (47%) tests/integration/__snapshots__/imagemin.test.ts.snap

By default, once installed, the extension will lossily compress everything it can. All the assets I've tried look great and are much smaller than what imagemin emits. But, if someone wants lossless compression or to do something wildly different, they can still configure squoosh with bud.imagemin.

Our default config will convert assets to webp if you append ?as=webp to an asset url / import.

background: url('images/pic.png?as=webp');

Configuring

From updated docs:

To compress assets losslessly:

bud.imagemin('lossless')

To compress assets in a lossy manner:

bud.imagemin('lossy')

Custom config

To provide your own configuration options you can pass a callback which
will receive and should return the options.

bud.imagemin(options => ({
  ...options,
  // ...override
}))

@kellymears kellymears added this to the 5.1.0 milestone Dec 21, 2021
@kellymears kellymears self-assigned this Dec 21, 2021
@github-actions github-actions bot added @roots/bud-imagemin dependencies Pull requests that update a dependency file docs examples labels Dec 21, 2021
@github-actions github-actions bot added the test label Dec 21, 2021
site/extensions/bud-imagemin.mdx Outdated Show resolved Hide resolved
Co-authored-by: QWp6t <QWp6t@users.noreply.github.com>
@kellymears kellymears merged commit 58ad75d into next Dec 22, 2021
@kellymears kellymears deleted the image-minimizer-upgrade branch December 22, 2021 22:38
@kellymears kellymears mentioned this pull request Dec 22, 2021
3 tasks
@kellymears kellymears added this to next in Project releases Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file docs examples @roots/bud-imagemin test
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants