emaphp / underscore-template-loader

A Underscore and Lodash template loader for Webpack
MIT License
104 stars 24 forks source link

Cannot output a value that is not escaped to the template #33

Open zhongzihao-world opened 5 years ago

zhongzihao-world commented 5 years ago

Hello, I am having some problems with this loader. I need to output unescaped data in this div, but it always bothers me for a long time. We look forward to your reply. code snippet: <div id="get_data" style="display:none"> <%- JSON.stringify(htmlWebpackPlugin.options.data) %> </div> errors: errors: Template execution failed: ReferenceError: _ is not defined

Kolobok12309 commented 4 years ago

Add this to options of loader

{
...
engine: 'lodash',
}