{"id":19908827,"url":"https://github.com/vseventer/raw-custom-loader","last_synced_at":"2026-05-09T12:37:59.472Z","repository":{"id":65482535,"uuid":"82040019","full_name":"vseventer/raw-custom-loader","owner":"vseventer","description":"Custom loader module for webpack.","archived":false,"fork":false,"pushed_at":"2017-12-07T19:31:48.000Z","size":12,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-28T16:22:16.155Z","etag":null,"topics":["custom-loader","loader","webpack-loader","webpack2"],"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/vseventer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-15T08:55:25.000Z","updated_at":"2018-10-01T00:40:07.000Z","dependencies_parsed_at":"2023-01-25T10:45:27.924Z","dependency_job_id":null,"html_url":"https://github.com/vseventer/raw-custom-loader","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/vseventer/raw-custom-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vseventer%2Fraw-custom-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vseventer%2Fraw-custom-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vseventer%2Fraw-custom-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vseventer%2Fraw-custom-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vseventer","download_url":"https://codeload.github.com/vseventer/raw-custom-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vseventer%2Fraw-custom-loader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32819823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"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":["custom-loader","loader","webpack-loader","webpack2"],"created_at":"2024-11-12T21:13:35.428Z","updated_at":"2026-05-09T12:37:59.444Z","avatar_url":"https://github.com/vseventer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# raw-custom-loader\n\u003e Raw custom loader module for webpack.\n\n## Install\n`$ npm install raw-custom-loader`\n\n## Usage\nThis module is useful for those times you want a loader but cant find or want to write one. How about just writing a function instead? Please note this is a raw loader.\n\n### Example 1\nPerforms a simple string replace.\n\n```\n{\n  module: {\n    rules: [{\n      test: /\\.js$/,\n      use: {\n        loader: 'raw-custom-loader',\n        options: {\n          callback: (source) =\u003e {\n            return source.replace('foo', 'bar');\n          }\n        }\n      }\n    }]\n  }\n};\n```\n\n### Example 2\nUsing [`sharp`](https://www.npmjs.com/package/sharp), returns the grayscale version of the resource.\n\n```\n{\n  module: {\n    rules: [{\n      test: /\\.(gif|jpe?g|png|svg|tiff|webp)$/,\n      use: {\n        loader: 'raw-custom-loader',\n        options: {\n          callback: (source, sourceMap, callback) =\u003e {\n            sharp(source).grayscale().toBuffer(callback);\n          }\n        }\n      }\n    }]\n  }\n};\n```\n\n## Changelog\nSee the [Changelog](./CHANGELOG.md) for a list of changes.\n\n## License\n    The MIT License (MIT)\n\n    Copyright (c) 2017 Mark van Seventer\n\n    Permission is hereby granted, free of charge, to any person obtaining a copy of\n    this software and associated documentation files (the \"Software\"), to deal in\n    the Software without restriction, including without limitation the rights to\n    use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n    the Software, and to permit persons to whom the Software is furnished to do so,\n    subject to the following conditions:\n\n    The above copyright notice and this permission notice shall be included in all\n    copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n    FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n    COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n    IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n    CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvseventer%2Fraw-custom-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvseventer%2Fraw-custom-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvseventer%2Fraw-custom-loader/lists"}