extract-loader icon indicating copy to clipboard operation
extract-loader copied to clipboard

undefined image src if image used twice in html

Open mbibko opened this issue 5 years ago • 1 comments

webpack.config.js

  mode: 'development',
  module: {
    rules: [
      {
        test: /\.html$/i,
        use: ['file-loader?name=[name].[ext]', 'extract-loader', 'html-loader'],
      },
      {
        test: /\.jpg$/,
        use: ['file-loader?name=[name].[ext]'],
      }
    ],
  },
};

src/index.js import './index.html'

src/index.html

<img src="img.jpg">
<img src="img.jpg">

src/img.jpg simple image

When I run webpack, it generates index.html file with this html:

<img src="img.jpg">
<img src="undefined">

The first img tag has correct src, but the second src is undefined.

I think problem with extract-loader. Thanks for help.

mbibko avatar May 14 '20 15:05 mbibko

@mbibko Fixed in #83

vseventer avatar May 19 '20 14:05 vseventer