{"id":16068140,"url":"https://github.com/milewski/imagemin-loader","last_synced_at":"2025-03-18T05:31:08.064Z","repository":{"id":57272291,"uuid":"86899274","full_name":"milewski/imagemin-loader","owner":"milewski","description":"Imagemin loader module for webpack.","archived":false,"fork":false,"pushed_at":"2023-07-29T11:42:05.000Z","size":1307,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T07:33:00.805Z","etag":null,"topics":["image-compression","imagemin","loader","optimization","webpack","webpack-loader"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/milewski.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-01T08:47:57.000Z","updated_at":"2023-08-05T10:05:46.000Z","dependencies_parsed_at":"2024-06-19T01:54:14.791Z","dependency_job_id":"5919ff6d-7ed1-4955-bd0c-d89b15bfb62e","html_url":"https://github.com/milewski/imagemin-loader","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/milewski%2Fimagemin-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milewski%2Fimagemin-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milewski%2Fimagemin-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milewski%2Fimagemin-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/milewski","download_url":"https://codeload.github.com/milewski/imagemin-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243903164,"owners_count":20366434,"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":["image-compression","imagemin","loader","optimization","webpack","webpack-loader"],"created_at":"2024-10-09T06:08:42.500Z","updated_at":"2025-03-18T05:31:05.380Z","avatar_url":"https://github.com/milewski.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# imagemin-loader\n\n[![npm version](https://badge.fury.io/js/imagemin-loader.svg)](https://badge.fury.io/js/imagemin-loader)\n[![npm downloads](https://img.shields.io/npm/dm/imagemin-loader.svg)](https://www.npmjs.com/package/imagemin-loader)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nImagemin hook for webpack 3\n\n\u003e Minify all images seamlessly with [imagemin](https://github.com/kevva/imagemin)\n\n## Oh. but Why?\n\nBecause none of the other loaders out there would allow me to use my own imagemin plugin.\n\n## Install\n\n```bash\n$ npm install imagemin-loader -D\n```\n## Usage\n\nIn your `webpack.config.js` add the imagemin-loader, chained with the [file-loader](https://github.com/webpack/file-loader), [url-loader](https://github.com/webpack/url-loader) or [raw-loader](https://github.com/webpack/raw-loader):\n\n```js\nmodule: {\n    rules: [\n        {\n            test: /\\.(png|jpe?g|gif|svg)$/,\n            use: [\n                \n                /** file-loader | url-loader | raw-loader **/\n                { loader: 'file-loader' },\n                \n                {\n                    loader: 'imagemin-loader',\n                    options: {\n                        // enabled: process.env.NODE_ENV === 'production',\n                        plugins: [\n                            {\n                                use: 'imagemin-pngquant',\n                                options: {\n                                    quality: '50-60'\n                                }\n                            },\n                            {\n                                /** Alternative syntax **/\n                                use: require('imagemin-guetzli'),\n                                options: {\n                                    enabled: process.env.NODE_ENV === 'production',\n                                    quality: 95\n                                }\n                            }\n                        ]\n                    }\n                }\n            ]\n        }\n    ]\n}\n```\nYou can use any [imagemin plugin](https://www.npmjs.com/browse/keyword/imageminplugin), simple include it on the plugin array and install it as a local dependency.\n\n### Options\n\n```typescript\n{\n    enabled: boolean, // Enable or disable the loader globally\n    plugins: [\n        {\n            use: string|function, // Package name like: 'imagemin-gifsicle', require('imagemin-gifsicle') or a Function\n            options: {\n                enabled: boolean, // Enable or disable at the plugin level\n                ...ImageMinPluginOptions // Specific plugin options\n            }\n        }\n    ]\n}\n```\n## License \n\n[MIT](LICENSE) © [Rafael Milewski](https://github.com/milewski)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilewski%2Fimagemin-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilewski%2Fimagemin-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilewski%2Fimagemin-loader/lists"}