dazuaz / responsive-loader

A webpack loader for responsive images
BSD 3-Clause "New" or "Revised" License
647 stars 74 forks source link

responsive-loader does not work on react-scripts 5.0.0 #148

Closed quocvan1311 closed 2 years ago

quocvan1311 commented 2 years ago

I faced the issue that the image file got loaded when using react-scripts 5.0.0 is a base64 string (but the content is not the image also). For react-scripts 4.0.3, it works normally as it returned the object { src, srcSet... }. Here is my rules for the loader

      {
        test: /\.(jpe?g|png|webp)$/i,
        type: "javascript/auto",
        use: [
          {
            loader: "responsive-loader",
            options: {
              adapter: require("responsive-loader/sharp")
            }
          }
        ]
      }
dazuaz commented 2 years ago

Solved in version 3 that supports webpack 5