webpack-html-loader

How can I provide parameters for webpack html-loader interpolation?

老子叫甜甜 提交于 2019-11-27 01:06:00
问题 In the html-loader documentation there is this example require("html?interpolate=require!./file.ftl"); <#list list as list> <a href="${list.href!}" />${list.name}</a> </#list> <img src="${require(`./images/gallery.png`)}"> <div>${require('./components/gallery.html')}</div> Where does "list" come from? How can I provide parameters to the interpolation scope? I would like to do something like template-string-loader does: var template = require("html?interpolate!./file.html")({data: '123'}); and