{"id":20709513,"url":"https://github.com/hmpl-language/hmpl-loader","last_synced_at":"2026-02-26T09:15:51.034Z","repository":{"id":262085077,"uuid":"883886553","full_name":"hmpl-language/hmpl-loader","owner":"hmpl-language","description":"Loader for files with hpml extension for Webpack","archived":false,"fork":false,"pushed_at":"2025-11-15T20:18:42.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-15T22:07:08.112Z","etag":null,"topics":["hmpl","hmpl-js","loader","webpack","webpack-loader","webpack-loaders"],"latest_commit_sha":null,"homepage":"https://hmpl-lang.dev/webpack","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/hmpl-language.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,"zenodo":null}},"created_at":"2024-11-05T18:43:41.000Z","updated_at":"2025-11-15T20:04:04.000Z","dependencies_parsed_at":"2024-11-10T13:18:56.533Z","dependency_job_id":"fa864727-44ee-4e4a-8329-3b2cedd73d78","html_url":"https://github.com/hmpl-language/hmpl-loader","commit_stats":null,"previous_names":["hmpl-language/hmpl-loader"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/hmpl-language/hmpl-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmpl-language%2Fhmpl-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmpl-language%2Fhmpl-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmpl-language%2Fhmpl-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmpl-language%2Fhmpl-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hmpl-language","download_url":"https://codeload.github.com/hmpl-language/hmpl-loader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmpl-language%2Fhmpl-loader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29855200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T08:51:08.701Z","status":"ssl_error","status_checked_at":"2026-02-26T08:50:19.607Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["hmpl","hmpl-js","loader","webpack","webpack-loader","webpack-loaders"],"created_at":"2024-11-17T02:06:41.305Z","updated_at":"2026-02-26T09:15:51.029Z","avatar_url":"https://github.com/hmpl-language.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hmpl-loader\n\n[![npm-version](https://img.shields.io/npm/v/hmpl-loader?logo=npm\u0026color=fff)](https://www.npmjs.com/package/hmpl-loader)\n\nThis loader was created for files with the `.hmpl` extension, which are converted using the [hmpl-js](https://www.npmjs.com/package/hmpl-js) package. This loader is designed for webpack.\n\n\u003e Loader works with hmpl-js version 1.0.4 or higher\n\n## Installation\n\n```bash\nnpm i -D hmpl-loader\n```\n\n## Usage:\n\nIn the `webpack.config.js` file you can specify the following lines of code:\n\n```javascript\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.hmpl$/i,\n        use: [\"hmpl-loader\"],\n      },\n    ],\n  },\n};\n```\n\nAfter `webpack.config.js` has been changed, in js files (for example, in `main.js`), you can import a file with the `.hmpl` extension and receive a [template function](https://hmpl-lang.dev/functions/template/) in response.\n\n### main.hmpl\n\n```hmpl\n\u003cdiv\u003e\n  {{#request src=\"/api/test\"}}\n  {{/request}}\n\u003c/div\u003e\n```\n\n### main.js\n\n```javascript\nconst templateFn = require(\"./main.hmpl\");\n\nconst elementObj = templateFn();\n```\n\n## Options\n\nThe loader supports the compile function options.\n\n```javascript\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.hmpl$/i,\n        use: {\n          loader: \"hmpl-loader\",\n          options: {\n            memo: true,\n            autoBody: { formData: true },\n            allowedContentTypes: [\"text/html\"],\n            disallowedTags: [\"script\"],\n            sanitize: false,\n            sanitizeConfig: { USE_PROFILES: { html: true } },\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\nThe list of options is described in the documentation [here](https://hmpl-lang.dev/objects/hmpl/#compile).\n\n## Changelog\n\n[Changelog](https://github.com/hmpl-language/hmpl-loader/releases)\n\n## License\n\n[Licensed under MIT](https://github.com/hmpl-language/hmpl-loader/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmpl-language%2Fhmpl-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmpl-language%2Fhmpl-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmpl-language%2Fhmpl-loader/lists"}