to after production build. " /> to after production build. " /> to after production build. "/>

How change path to my new generated webp image in index.html?

14 views Asked by At

I can't change the path <img src="public/assets/images/some-image.png" /> to <img src="dist/assets/images/some-image.webp" /> after production build.

I use this to generate .webp images from .png files:

generator: [
  {
    type: 'asset',
    implementation: ImageMinimizerPlugin.imageminGenerate,
    options: {
      plugins: ['imagemin-webp'],
    },
  },
],

I also use HtmlWebpackPlugin to create the bundle and index in the dist folder. My folder structure:

dist/
    index.html
    assets/
       /images
       /fonts
       ...
public/
    assets/
       /images
       /fonts
src/
    index.html
    ...
0

There are 0 answers