title: Webpack - How to convert jpg/png to webp via image-webpack-loader
body: <p>I want to generate webp files from jpg/png from webpack.
  To do that i using image-webpack-plugin (<em><a href="https://github.com/tcoopman/image-webpack-loader" rel="noreferrer">https://github.com/tcoopman/image-webpack-loader</a></em>)</p>
  
  <p>In the plugin documentation it's written that the webp additional optimizer <em>"Compress JPG &amp; PNG images into WEBP"</em> (<a href="https://github.com/tcoopman/image-webpack-loader#usage" rel="noreferrer">https://github.com/tcoopman/image-webpack-loader#usage</a>) but after followed the documentation steps the conversion not work.</p>
  
  <p>The files are exported in jpg but nothing is converted.</p>
  
  <p><em>I've already followed these posts but i've don't understand how to translate in a "non-react" environment :</em></p>
  
  <ol>
  <li><p><a href="https://stackoverflow.com/questions/57699807/webpack-imagemin-plugin-to-compress-jpg-png-and-create-webp">Webpack imagemin plugin to compress jpg, png and create webp?</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/53483962/webpack-encore-convert-images-to-webp-using-image-webpack-loader">Webpack (Encore): convert images to webp using image-webpack-loader</a></p></li>
  </ol>
  
  <p><strong><code>webpack.config.js</code></strong></p>
  
  <pre><code> { 
     test:/\.(gif|png|jpe?g|svg)$/i,
     use:[ 
        { 
           loader:'file-loader',
           options:{ 
              outputPath:'images',
              name:'[name].[ext]'
           }
        },
        { 
           loader:'image-webpack-loader',
           options:{ 
              mozjpeg:{ 
                 progressive:true,
                 quality:65
              },
              optipng:{ enabled: false },
              pngquant:{ quality: [ 0.65, 0.90 ], speed:4 },
              gifsicle:{ interlaced: false },
              webp:{ quality: 75 }
           }
        }
     ]
  }
  </code></pre>
  
  <p>Is there a reliable and clean way to turn jpg / png files into webp via webpack ?</p>