HyperHTML loader for webpack
turns
<span>${state.value}</span>
into
module.exports = (render, scope) => render`
<span>${state.value}</span>
`
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.hyper.html?$/,
use: [
{
loader: 'babel-loader'
},
{
loader: 'hyper-html-loader'
},
]
},
...
],
},
...
};
variable: scope variable name (default scope
)