Images optimization with webpack
To prebuild images for various breakpoints using webpack and implement them with responsive design, you should use build-time tools to generate the different image sizes and then use HTML's srcset and picture elements for implementation, as using CSS media queries to change image sources is less efficient. [1, 2, 3, 4]
Use a webpack plugin and image processing library to automatically generate multiple image sizes during the build process. A common combination is the image-minimizer-webpack-plugin with sharp. [5, 6]
const ImageMinimizerPlugin = require('image-minimizer-webpack-plugin');