Webpack
Module has its own loader for files with the .hmpl
extension. You can include hmpl-loader and use the template language syntax in separate files:
main.hmpl
Section titled “main.hmpl”<div> {{#request src="/api/test"}}{{/request}}</div>
main.js
Section titled “main.js”const templateFn = require("./main.hmpl");
const elementObj = templateFn();
For the loader to work, it is better to use versions 0.0.2
or higher.