thanks for any feedback...
I have an HTML template with JS string literals embedded...
<html>
<head>
<title>${title}</title>
</head>
<body>
User name: ${user.name}
</body>
</html>
let temp = require('./template.html')
return temp; // <--- I need this to return the compiled html
You can create a new Function to turn it into a string template
return new Function("title","user","return `" + temp + "`;")(title,user);
As pointed out by T.J you will need to know all the variables used in the template and include them as arguments to the function.