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

Commit

Permalink
Update imagemin code samples (#2524)
Browse files Browse the repository at this point in the history
  • Loading branch information
djpowers authored Apr 10, 2020
1 parent 1c272a6 commit 0ce45b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/site/content/en/fast/serve-images-webp/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ save them in the `compressed_images` directory.
const imagemin = require('imagemin');
const imageminWebp = require('imagemin-webp');

imagemin(['images/*'], 'compressed_images', {
use: [imageminWebp({quality: 50})]
imagemin(['images/*'], {
destination: 'compressed_images',
plugins: [imageminWebp({quality: 50})]
}).then(() => {
console.log('Done!');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,10 @@ const imageminMozjpeg = require('imagemin-mozjpeg');
(async() => {
const files = await imagemin(
['source_dir/*.jpg', 'another_dir/*.jpg'],
'destination_dir',
{plugins: [imageminMozjpeg({quality: 50})]}
{
destination: 'destination_dir',
plugins: [imageminMozjpeg({quality: 50})]
}
);
console.log(files);
})();
Expand Down

0 comments on commit 0ce45b3

Please sign in to comment.