{"id":13671301,"url":"https://github.com/vanwagonet/img-loader","last_synced_at":"2026-07-31T22:07:29.200Z","repository":{"id":28178479,"uuid":"31679942","full_name":"vanwagonet/img-loader","owner":"vanwagonet","description":"Image minimizing loader for webpack","archived":false,"fork":false,"pushed_at":"2023-04-14T08:19:18.000Z","size":157,"stargazers_count":162,"open_issues_count":3,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-24T13:32:37.503Z","etag":null,"topics":["imagemin","javascript","loader","webpack"],"latest_commit_sha":null,"homepage":null,"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/vanwagonet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-03-04T21:08:54.000Z","updated_at":"2024-02-22T17:26:21.000Z","dependencies_parsed_at":"2024-01-14T17:03:26.040Z","dependency_job_id":"2387e582-7844-489c-9172-a3be60597be6","html_url":"https://github.com/vanwagonet/img-loader","commit_stats":{"total_commits":59,"total_committers":9,"mean_commits":6.555555555555555,"dds":0.728813559322034,"last_synced_commit":"8d05097f286cf4793c56691a3a5f959cac74075f"},"previous_names":["thetalecrafter/img-loader"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/vanwagonet/img-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanwagonet%2Fimg-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanwagonet%2Fimg-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanwagonet%2Fimg-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanwagonet%2Fimg-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanwagonet","download_url":"https://codeload.github.com/vanwagonet/img-loader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanwagonet%2Fimg-loader/sbom","scorecard":{"id":916210,"data":{"date":"2025-08-11","repo":{"name":"github.com/vanwagonet/img-loader","commit":"8d05097f286cf4793c56691a3a5f959cac74075f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Code-Review","score":3,"reason":"Found 4/12 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/vanwagonet/img-loader/node.js.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/vanwagonet/img-loader/node.js.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/node.js.yml:28","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/node.js.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE-MIT:0","Info: FSF or OSI recognized license: MIT License: LICENSE-MIT:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 23 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T21:05:18.001Z","repository_id":28178479,"created_at":"2025-08-24T21:05:18.001Z","updated_at":"2025-08-24T21:05:18.001Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36135106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-31T02:00:06.731Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["imagemin","javascript","loader","webpack"],"created_at":"2024-08-02T09:01:05.510Z","updated_at":"2026-07-31T22:07:29.182Z","avatar_url":"https://github.com/vanwagonet.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# img-loader\n\n[![npm Version][npm-image]][npm]\n[![MIT License][license-image]][LICENSE]\n\nImage minimizing loader for webpack 4, meant to be used with [url-loader](https://github.com/webpack/url-loader), [file-loader](https://github.com/webpack/file-loader), or [raw-loader](https://github.com/webpack/raw-loader)\n\n\u003e Minify PNG, JPEG, GIF and SVG images with [imagemin](https://github.com/imagemin/imagemin) [plugins](https://www.npmjs.com/search?q=keywords:imageminplugin)\n\nimg-loader has a peer dependency on `imagemin`, so you will need to make sure to include that, along with any imagemin plugins you will use.\n\n\n## Install\n\n```sh\n$ npm install img-loader --save-dev\n```\n\n\n## Usage\n\n[Documentation: Using loaders](https://webpack.js.org/concepts/loaders/)\n\n```javascript\nmodule: {\n  rules: [\n    {\n      test: /\\.(jpe?g|png|gif|svg)$/i,\n      use: [\n        'url-loader?limit=10000',\n        'img-loader'\n      ]\n    }\n  ]\n}\n```\n\nBy default the loader simply passes along the image unmodified.\n\n\n### Options\n\nOptions are forwarded to `imagemin.buffer(image, options)`, so any plugins you would like to use for optimizing the images are passed as the `plugins` property.\n\nFor more details on each plugin's options, see their documentation on [Github](https://github.com/imagemin).\n\n```js\n{\n  module: {\n    rules: [\n      {\n        test: /\\.(jpe?g|png|gif|svg)$/i,\n        use: [\n          'url-loader?limit=10000',\n          {\n            loader: 'img-loader',\n            options: {\n              plugins: [\n                require('imagemin-gifsicle')({\n                  interlaced: false\n                }),\n                require('imagemin-mozjpeg')({\n                  progressive: true,\n                  arithmetic: false\n                }),\n                require('imagemin-pngquant')({\n                  floyd: 0.5,\n                  speed: 2\n                }),\n                require('imagemin-svgo')({\n                  plugins: [\n                    { removeTitle: true },\n                    { convertPathData: false }\n                  ]\n                })\n              ]\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n`plugins` can also be a function, which will receive the [webpack loader context](https://webpack.js.org/api/loaders/#the-loader-context) and should return the plugins array.\n```js\n{\n  module: {\n    rules: [\n      {\n        test: /\\.(jpe?g|png|gif|svg)$/i,\n        use: [\n          'url-loader?limit=10000',\n          {\n            loader: 'img-loader',\n            options: {\n              plugins (context) {\n                if (process.env.NODE_ENV === 'production') return []\n                return [\n                  require('imagemin-svgo')({\n                    plugins: [\n                      { cleanupIDs: false },\n                      {\n                        prefixIds: {\n                          prefix: path.basename(context.resourcePath, 'svg')\n                        }\n                      }\n                    ]\n                  })\n                ]\n              }\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nIf you only want to run imagemin in production builds, you can omit the `img-loader` or leave plugins empty in your production configuration file. If you don't keep a separate configuration for prod builds, something like the following also works:\n\n```js\n{\n  loader: 'img-loader',\n  options: {\n    plugins: process.env.NODE_ENV === 'production' \u0026\u0026 [\n      require('imagemin-svgo')({})\n      // etc.\n    ]\n  }\n}\n```\n\n\n## Migrating from 2.x\n\nTo get the default behavior from version `2.0.1`, you'll need to install these imagemin plugins:\n\n* [imagemin-gifsicle](https://github.com/imagemin/imagemin-gifsicle)\n* [imagemin-mozjpeg](https://github.com/imagemin/imagemin-mozjpeg)\n* [imagemin-optipng](https://github.com/imagemin/imagemin-optipng)\n* [imagemin-svgo](https://github.com/imagemin/imagemin-svgo)\n\nThen use this loader setup in your webpack configuration file:\n\n```js\n{\n  loader: 'img-loader',\n  options: {\n    plugins: [\n      require('imagemin-gifsicle')({}),\n      require('imagemin-mozjpeg')({}),\n      require('imagemin-optipng')({}),\n      require('imagemin-svgo')({})\n    ]\n  }\n}\n```\n\nThe options object you had under a plugin's name property, should instead be passed directly to the plugin after you require it.\n\nIf you used the optional `pngquant` settings, then you will additionally need to install [imagemin-pngquant](https://github.com/imagemin/imagemin-pngquant), and add it to your plugins array as any other imagemin plugin.\n\n\n## License\n\nThis software is free to use under the MIT license. See the [LICENSE-MIT file][LICENSE] for license text and copyright information.\n\n[npm]: https://www.npmjs.org/package/img-loader\n[npm-image]: https://img.shields.io/npm/v/img-loader.svg\n[license-image]: https://img.shields.io/npm/l/img-loader.svg\n[LICENSE]: https://github.com/vanwagonet/img-loader/blob/master/LICENSE-MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanwagonet%2Fimg-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanwagonet%2Fimg-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanwagonet%2Fimg-loader/lists"}