
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
hmpl-loader
Advanced tools
This loader was created for files with the .hmpl extension, which are converted using the hmpl-js package. This loader is designed for webpack.
Loader works with hmpl-js version 1.0.4 or higher
npm i -D hmpl-loader
In the webpack.config.js file you can specify the following lines of code:
module.exports = {
module: {
rules: [
{
test: /\.hmpl$/i,
use: ["hmpl-loader"],
},
],
},
};
After 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 in response.
<div>
{{#request src="/api/test"}}
{{/request}}
</div>
const templateFn = require("./main.hmpl");
const elementObj = templateFn();
The loader supports the compile function options.
module.exports = {
module: {
rules: [
{
test: /\.hmpl$/i,
use: {
loader: "hmpl-loader",
options: {
memo: true,
autoBody: { formData: true },
allowedContentTypes: ["text/html"],
disallowedTags: ["script"],
sanitize: false,
sanitizeConfig: { USE_PROFILES: { html: true } },
},
},
},
],
},
};
The list of options is described in the documentation here.
FAQs
Loader for files with hpml extension for webpack
We found that hmpl-loader demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.