Skip to content

Using HtmlResWebpackPlugin meet an Error #23

@zD98

Description

@zD98

My webpack config

new HtmlResWebpackPlugin({
      mode: 'html',
      filename: config.build.index,
      template: "index.html",
      inject: true,
      chunks: 
        {
          'app.js':{}
        }
    }),

And I meet a Error

Unhandled rejection TypeError: htmlContent.replace is not a function

I log the console.log(typeof compilation.assets[this.options.htmlFileName].source()), it is a function, but it should be a string.
So How do I fix this error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions