We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This works:
const Picture = ({ path, srcSizes, ...props }: PictureProps) => { return ( <picture> {srcSizes && srcSizes.map((size, index) => ( <source key={index} media={`(max-width: ${size}`} srcSet={require(`~/images/${path}?&webp`)} type="image/webp" /> ))} {/* <source srcSet={require(`~/images/${path}`)} type="image/jpeg" /> */} <img src={require(`~/images/${path}?`)} {...props} /> </picture> ); };
but using size param doesn't work (and it's installed and works otherwise outside the map):
<source key={index} media={`(max-width: ${size}`} srcSet={require(`~/images/${path}?size=${size}&webp`)} type="image/webp" />
More tests...
this works:
const sources = srcSizes.map((size) => require("~/images/" + path + "?size=" + 48 + "&webp") );
but this doesn't work:
const sources = srcSizes.map((size) => require("~/images/" + path + "?size=" + size + "&webp") );
Error:
The text was updated successfully, but these errors were encountered:
This is not an issue with this repo, but I guess this repo could work around it. here's the limitation: webpack/webpack#2992
Sorry, something went wrong.
No branches or pull requests
This works:
but using size param doesn't work (and it's installed and works otherwise outside the map):
More tests...
this works:
but this doesn't work:
Error:
The text was updated successfully, but these errors were encountered: