I
I
ivanDoligov2020-10-19 08:04:12
webpack
ivanDoligov, 2020-10-19 08:04:12

How to properly hash with html-webpack-plugin?

Good afternoon! Please tell me how to properly cache and then configure images in index.ejs so that they have a hash?
Example:
I see how it is used in the dock, as I understand it, the main thing is to write down the template that I will use

{
  plugins: [
    new HtmlWebpackPlugin({
      template: 'src/index.ejs'
      filename: 'favicon.ico'
    })
  ]
}


let's say I need to connect a favicon to the tag linkin index.ejs, but if I connect like this, then nothing happens? What am I doing wrong? Or how to use it correctly HtmlWebpackPlugin?

<link href="<%= htmlWebpackPlugin.options.filename %>"/>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question