lcxfs1991 / html-res-webpack-plugin

plugin for generating html in webpack
167 stars 34 forks source link

Using HtmlResWebpackPlugin meet an Error #23

Open zD98 opened 7 years ago

zD98 commented 7 years ago

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

lcxfs1991 commented 7 years ago

please tell me your webpack version.

zD98 commented 7 years ago

webpack@3.1.0 and this.options.htmlFileName's value is xxxx/dist/index.html