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
...
after production build. " />
to