1

The webpack html-loader breaks my html files by putting a 'module.exports' at the front of the html file.

module.exports = "<div> my html </div>"

I can't have this in my site.

Is there any way around this?

Weirdly, if I use the webpack dev-server this 'module.exports' does not appear, it is only when I publish it live.

my html loader is set up like this :

module: {
  loaders: [
    {
      test: /\.html$/,
      exclude: /node_modules/,
      use: {loader: 'html-loader',
        options: {
          attrs: [':data-src']
        }
      }
    }
Oliver Watkins
  • 12,575
  • 33
  • 119
  • 225

0 Answers0