Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #413 from adamstankiewicz/astankiewicz/upgrade-ima…
Browse files Browse the repository at this point in the history
…gemin-webp-v7

chore: upgrade imagemin-webp to v7.0.0
  • Loading branch information
tcoopman authored Jan 11, 2022
2 parents 5e241b4 + a08e7d1 commit 5fc7670
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 106 deletions.
10 changes: 8 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,14 @@ module.exports = function(content) {
if(options.optipng.enabled !== false)
plugins.push(require('imagemin-optipng')(options.optipng));
// optional optimizers
if(options.webp.enabled !== false)
plugins.push(require('imagemin-webp')(options.webp));
if(options.webp.enabled !== false) {
async function loadWebp() {
await import('imagemin-webp').then(({ default: imageminWebp }) => {
plugins.push(imageminWebp(options.webp));
});
}
loadWebp()
}

imagemin
.buffer(content, {
Expand Down
191 changes: 89 additions & 102 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
"imagemin-optipng": "^8.0.0",
"imagemin-pngquant": "^9.0.2",
"imagemin-svgo": "^9.0.0",
"imagemin-webp": "^6.0.0"
"imagemin-webp": "^7.0.0"
},
"devDependencies": {
"file-loader": "^6.2.0",
"rimraf": "^3.0.2",
"webpack": "^4.46.0",
"webpack-cli": "^4.8.0"
"webpack-cli": "^4.9.1"
}
}

0 comments on commit 5fc7670

Please sign in to comment.