html-res-webpack-plugin icon indicating copy to clipboard operation
html-res-webpack-plugin copied to clipboard

Using HtmlResWebpackPlugin meet an Error

Open zD98 opened this issue 8 years ago • 2 comments
trafficstars

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

zD98 avatar Aug 18 '17 18:08 zD98

please tell me your webpack version.

lcxfs1991 avatar Aug 19 '17 00:08 lcxfs1991

[email protected] and this.options.htmlFileName's value is xxxx/dist/index.html

zD98 avatar Aug 19 '17 03:08 zD98