Open
Description
Responsive-loader is generating all my images beautifully with the correct names and sizes, but I can't figure out how to reference other sizes than the default (smallest one) in my template!
// webpack.config file
...
{
test: /\.(jpe?g|png)$/i,
loader: 'responsive-loader',
options: {
adapter: require('responsive-loader/sharp'),
sizes: [600, 1200],
placeholder: true,
placeholderSize: 50,
name: '/assets/img/[hash]-[width].[ext]'
}
},
...
And this is how I'm referencing the images in my template html
<img src="${require('./assets/img/image_0.jpg')}" alt="">
This gives me the 600px wide image and I would like to get different images based on screen size. Any pointers?
Metadata
Metadata
Assignees
Labels
No labels