webpack-image-resize-loader
webpack-image-resize-loader copied to clipboard
Create thumbnail of original image
I have a folder of "large" images e.g. src/img/photos/my-photo.jpg
etc.
As-per webpack docs these are being copied to my dist
folder using Asset Modules i.e.
{
test: /\.(png|jpe?g|gif|svg|woff2?|ttf|eot)$/i,
type: 'asset/resource',
generator: {
filename: '[name].[contenthash][ext]',
},
}
I want to create 200x200px thumbnails i.e. "small" versions but also keep the "large" images being copied.
When I use webpack-image-resize-loader
(or webpack-sharp-loader
) in combination with either the Asset Modules approach as above or the old file-loader
approach, the resulting "large" image is broken and cannot be opened.
It seems these loaders interfere with separate file handling I have. Any ideas for a solution to this?