You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I read your messages how to combine PugPlugin and responsive-loader. It works.
But before it I used responsive-loader like: (it doesn't work)
webpack config - without format property
{test: /\.(gif|png|jpe?g|ico|svg|webp)$/i,type: 'asset/resource',// doesn't work without it - The reason: this file not found!include: [path.join(mySrcPath,"/assets/img")],use: {loader: "responsive-loader",options: {adapter: require("responsive-loader/sharp"),sizes: [100,200,300,400],// format: "jpg", I don't use itoutputPath: "assets/img",name: '[name]/[ext]/[name]-[width].[ext]',},},},
and pug file
-constmyWebp1=require('~Images/123.png?prop=width&format=webp');constmyWebp2=require('~Images/123.png?format=webp');constmyWebpSize1=require('~Images/123.png?sizes[]=100,sizes[]=200,sizes[]=300,sizes[]=400&format=webp'); // if no sizes property in config
It can be useful if I want to convert only some images.
You can use this repository above #8 (comment)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The original message from @silveoj is converted to this discussion.
I read your messages how to combine
PugPluginandresponsive-loader. It works.But before it I used
responsive-loaderlike: (it doesn't work)webpack config - without
formatpropertyand pug file
It can be useful if I want to convert only some images.
You can use this repository above #8 (comment)
Beta Was this translation helpful? Give feedback.
All reactions