{"id":18979687,"url":"https://github.com/nihgwu/partial-loader","last_synced_at":"2025-11-11T07:02:11.153Z","repository":{"id":57319726,"uuid":"147040157","full_name":"nihgwu/partial-loader","owner":"nihgwu","description":"partial loader for webpack","archived":false,"fork":false,"pushed_at":"2018-09-02T11:08:17.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T23:33:30.974Z","etag":null,"topics":["partial","template","webpack-loader"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nihgwu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-01T23:39:27.000Z","updated_at":"2018-09-02T11:08:50.000Z","dependencies_parsed_at":"2022-08-25T21:00:47.453Z","dependency_job_id":null,"html_url":"https://github.com/nihgwu/partial-loader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihgwu%2Fpartial-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihgwu%2Fpartial-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihgwu%2Fpartial-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihgwu%2Fpartial-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nihgwu","download_url":"https://codeload.github.com/nihgwu/partial-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239985688,"owners_count":19729512,"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":["partial","template","webpack-loader"],"created_at":"2024-11-08T15:44:26.995Z","updated_at":"2025-11-11T07:02:06.106Z","avatar_url":"https://github.com/nihgwu.png","language":"JavaScript","readme":"# partial-loader\n\npartial loader for webpack, transform your partial file with template\n\n## Install\n\n`npm install --save partial-loader`\n\n## How to use\n\nAdd the loader to your `webpack` config, For example:\n\n```javascript\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\/src\\/examples\\/(?!index).*\\.jsx?$/,\n        use: [\n          {\n            loader: 'partial-loader',\n            options: {\n              templatePath: `${__dirname}/example-template.js`,\n              placeholder: '/*** placeholder ***/',\n            },\n          },\n        ],\n      },\n    ],\n  },\n}\n```\n\n### Options\n\n- `template` - the content of template, should include the `placeholder` to be replaced.\n- `templatePath` - absolute path of the template file, `template` will be ignored if provided.\n- `placeholder` - placeholder to be replaced, defaults to `/*** placeholder ***/`.\n\n## Example\n\n1. template\n\n```javascript\nimport React from 'react'\nimport styled from 'styled-components'\n\n/*** placeholder ***/\n```\n\n2. code\n\n```javascript\nconst Button = styled.button`\n  border-radius: 3px;\n  padding: 0.25em 1em;\n  margin: 0 1em;\n  background: transparent;\n  color: palevioletred;\n  border: 2px solid palevioletred;\n`\n\nexport default Button\n```\n\n3. transformed\n\n```javascript\nimport React from 'react'\nimport styled from 'styled-components'\n\nconst Button = styled.button`\n  border-radius: 3px;\n  padding: 0.25em 1em;\n  margin: 0 1em;\n  background: transparent;\n  color: palevioletred;\n  border: 2px solid palevioletred;\n`\n\nexport default Button\n```\n\n## License\n\nMIT © [Neo](https://github.com/nihgwu)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnihgwu%2Fpartial-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnihgwu%2Fpartial-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnihgwu%2Fpartial-loader/lists"}