A
A
andrewayder2021-12-08 10:30:58
webpack
andrewayder, 2021-12-08 10:30:58

What is in <%%> webpack index.html?

Hello, webpack processes in index.html, for example, what is it in this case, the attempt does not display anything ... <%= htmlWebpackPlugin.options.title %>
<% %><% console.log("sdffsd") %>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
black1277, 2021-12-08
@black1277

this is the template string. At this point, a variable called title from the htmlWebpackPlugin plugin will be substituted in ntml. The variable itself must be defined in the plugin options. Read the github documentation . Example

plugins: [
  new HtmlWebpackPlugin({
    title: 'Custom template',
    // Load a custom template (lodash by default)
    template: 'index.html'
  })
]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question