{"id":28580155,"url":"https://github.com/revan-zhang/placeholder-loader","last_synced_at":"2026-05-10T16:41:16.600Z","repository":{"id":127551425,"uuid":"100553477","full_name":"revan-zhang/placeholder-loader","owner":"revan-zhang","description":"pipe the raw content to next loader in webpack","archived":false,"fork":false,"pushed_at":"2017-08-27T15:11:58.000Z","size":16,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-11T03:15:14.114Z","etag":null,"topics":["loader","webpack","webpack-loader"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/revan-zhang.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-08-17T02:38:30.000Z","updated_at":"2023-03-04T05:48:35.000Z","dependencies_parsed_at":"2023-05-23T07:15:45.278Z","dependency_job_id":null,"html_url":"https://github.com/revan-zhang/placeholder-loader","commit_stats":null,"previous_names":["revan-zhang/placeholder-loader","loatheb/placeholder-loader"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/revan-zhang/placeholder-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revan-zhang%2Fplaceholder-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revan-zhang%2Fplaceholder-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revan-zhang%2Fplaceholder-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revan-zhang%2Fplaceholder-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/revan-zhang","download_url":"https://codeload.github.com/revan-zhang/placeholder-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revan-zhang%2Fplaceholder-loader/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265477308,"owners_count":23773029,"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":["loader","webpack","webpack-loader"],"created_at":"2025-06-11T03:12:39.159Z","updated_at":"2026-05-10T16:41:11.571Z","avatar_url":"https://github.com/revan-zhang.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# placeholder-loader\n  always return the same source code when pass to the placeholder-loader\n\n  why we need this?\n  bacause in webpack must pass a non-string in loader array, like:\n\n```js\n  {\n    test: /\\.js$/,\n    use: [\n      'babel-loader',\n      'ts-loader',\n    ]\n  }\n```\n\n  but sometime, we want to use different loader in different env, like:\n\n```js\n  {\n    test: /\\.js$/,\n    use: [\n      'babel-loader',\n      process.env.NODE_ENV === 'production' ? 'awesome-typescript-loader' : 'ts-loader'\n    ]\n  }\n```\n\n  the placeholder loader is to solve some config like this:\n\n```js\n  {\n    test: /\\.js$/,\n    use: [\n      'babel-loader',\n      process.env.NODE_ENV === 'SERVER_RENDERING' ? '' : 'promise-loader'\n    ]\n  }\n```\n\n  in the config above, we don't use promise-loader when the SERVER_RENDERING is true,\n  but webpack doesn't allow empty string, we must write something at there.\n  so, we can write the path to placeholder-loader, it will pipe the code to next loader.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevan-zhang%2Fplaceholder-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frevan-zhang%2Fplaceholder-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevan-zhang%2Fplaceholder-loader/lists"}