{"id":16149952,"url":"https://github.com/aeyoll/imagemin-avif-webpack-plugin","last_synced_at":"2026-04-30T15:32:07.888Z","repository":{"id":57272255,"uuid":"412768116","full_name":"aeyoll/imagemin-avif-webpack-plugin","owner":"aeyoll","description":"Webpack plugin which converts images to the Avif format while also keeping the original files. ","archived":false,"fork":false,"pushed_at":"2022-12-01T15:25:59.000Z","size":1155,"stargazers_count":0,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-13T04:29:54.569Z","etag":null,"topics":["avif","imagemin","imagemin-avif","images","webpack","webpack-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aeyoll.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-02T10:50:27.000Z","updated_at":"2021-10-02T10:56:50.000Z","dependencies_parsed_at":"2023-01-23T20:31:27.084Z","dependency_job_id":null,"html_url":"https://github.com/aeyoll/imagemin-avif-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeyoll%2Fimagemin-avif-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeyoll%2Fimagemin-avif-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeyoll%2Fimagemin-avif-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeyoll%2Fimagemin-avif-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aeyoll","download_url":"https://codeload.github.com/aeyoll/imagemin-avif-webpack-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557749,"owners_count":20958047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avif","imagemin","imagemin-avif","images","webpack","webpack-plugin"],"created_at":"2024-10-10T00:46:06.716Z","updated_at":"2026-04-30T15:32:02.852Z","avatar_url":"https://github.com/aeyoll.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# imagemin-avif-webpack-plugin\n\n\n**Webpack** plugin which converts images to the [Avif](https://developers.google.com/speed/webp/) format while also keeping the original files. Compatible with **webpack 5**, **webpack 4** and previous versions as well.\n\n\nIt uses [imagemin](https://www.npmjs.com/package/imagemin), [imagemin-avif](https://www.npmjs.com/package/imagemin-avif) under the hood.\n\nShoutout to @iampava and its [imagemin-webp-webpack-plugin](https://github.com/iampava/imagemin-webp-webpack-plugin), which this repo is based on.\n\n\n## Motivation\n\nA modern image format based on the AV1 video format. AVIF generally has better compression than WebP, JPEG, PNG and GIF and is designed to supersede them. AVIF competes with JPEG XL which has similar compression quality and is generally seen as more feature-rich than AVIF.\n\nCheck the support tables on [Can I use](https://caniuse.com/#feat=avif)\n\n\n## Installation\n\n\n\n```bash\n$ npm install imagemin-avif-webpack-plugin --save-dev\n```\n\n\n\n## Usage\n\n\n\nIn order to use this plugin, add it to your **webpack config**.\n\n\n\n```js\nconst ImageminAvifWebpackPlugin= require(\"imagemin-avif-webpack-plugin\");\n\nmodule.exports = {\n    plugins: [new ImageminAvifWebpackPlugin()]\n};\n```\n⚠ Keep in mind that plugin order matters, so usually you'd want to put it last.\n\n\n\n## API\n\n\n\n### ```new ImageminAvifWebpackPlugin( [settings] );```\n\n\n\n### settings\n\n\n\nType: `Object`\u003cbr/\u003e\n\nDefault:\n\n```js\n{\n  config: [{\n    test: /\\.(jpe?g|png)/,\n    options: {\n      quality:  75\n    }\n  }],\n  overrideExtension: true,\n  detailedLogs: false,\n  silent: false,\n  strict: true\n}\n```\n\n#### config\nType ```Array\u003cObject: {test, options} \u003e```\n\n\nThe main config of the plugin which controls how different file types are converted. Each item in the array is an object with 2 properties:\n\n* **test** - a RegExp selecting just certain images. Supported image formats are **JPG**, **PNG** and **GIF**.\n* **options** -the converting options for the images that pass the above RegExp\n\n⚠ The **options** object is actually the same one from the [imagemin-avif](https://www.npmjs.com/package/imagemin-avif) plugin so check their documentation for the available settings.\n\n#### overrideExtension\n\nType: `boolean`\u003cbr\u003e\nDefault: `true`\n\nBy default the plugin will override the original file extension, so you will get: `image.png` -\u003e `image.avif`\n\nIn case you want to concat '.avif' at the end of the file name, set the config value to false. Ex: `image.png` -\u003e `image.png.avif`. It may be useful when using nginx or similar to serve .avif files, if http-accept header contains avif just add a suffix to the requested image.\n\n#### detailedLogs\n\nType: `boolean`\u003cbr\u003e\nDefault: `false`\n\nBy default the plugin will print to the console\n\n1. the total number of megabytes saved by the avif images compared to the original ones\n2. the number of images that failed being converted\n\nThis options tells the plugin to also log the size difference per converted image and the names of the images that failed conversion.\n\n#### silent\n\nType: `boolean`\u003cbr\u003e\nDefault: `false`\n\nIn case you don't want anything printed to the console set this option to false. This will override the `detailedLogs` option. \u003cbr\u003e\n\n#### strict\n\nType: `boolean`\u003cbr\u003e\nDefault: `true`\n\nBy default the webpack build will fail if any of the images that match your RegExps fail the conversion.\n\nThis option tells the plugin to not crash the build and keep going :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faeyoll%2Fimagemin-avif-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faeyoll%2Fimagemin-avif-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faeyoll%2Fimagemin-avif-webpack-plugin/lists"}