Skip to content

Add support for srcset #55

New issue

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

Merged
merged 5 commits into from
Jul 25, 2016
Merged

Add support for srcset #55

merged 5 commits into from
Jul 25, 2016

Conversation

akesser
Copy link
Contributor

@akesser akesser commented Feb 23, 2016

I added support for comma separated lists in attributes to be able to handle srcset
For example

<img src="image.jpg" srcset="image.jpg 1x, [email protected] 2x">

is converted to

"<img src=\"" + require("./image.jpg") + "\" srcset=\"" + require("./image.jpg") + " 1x, " + require("./[email protected]") + " 2x \">"

Gruß

-akesser-

@sokra
Copy link
Member

sokra commented Mar 26, 2016

Good idea, but I think this could be solved in a more elegant way.

Try to leave all existing code as it was before and only modify the links array before this line: https://github.com/webpack/html-loader/pull/55/files#diff-168726dbe96b3ce427e7fedce31bb0bcR44

This way we don't need to touch the additional stuff after the url.

And please add some tests.

akesser added 2 commits April 11, 2016 19:03
Added support for img:secset and other comma serperated lists; img:srcset is handeled by default
# Conflicts:
#	README.md
@akesser
Copy link
Contributor Author

akesser commented Apr 11, 2016

As you suggested I implemented the srcset support by only modifying the links array. And I added some tests.

@frutality
Copy link

Any news on merging? Just googled this issue. Srcset is very useful attribute, and we really can use it according to caniuse. Most of default retina-devices browsers support it.

@xzilja
Copy link

xzilja commented May 23, 2016

Any idea on when this pull request will be merged?

@niieani
Copy link

niieani commented Jun 2, 2016

You know - what would be even more awesome is if the loader could automatically generate a srcset for multiple target resolutions, in case the original image is large.

@joshwiens
Copy link
Member

@iljadaderko - Shortly
@niieani - Throw up an issue for discussion, that sounds like a handy feature.

@hemanth - LGTM though a second set of eyes would be helpful.

@joshwiens
Copy link
Member

@akesser - Please pull in the latest changes from master to enable all the Travis validations prior to merge.

@hemanth
Copy link
Contributor

hemanth commented Jul 25, 2016

@d3viant0ne #66 needs a rebase.

@joshwiens
Copy link
Member

#66 can be closed. Travis updates in master accomplished the same thing

@hemanth hemanth merged commit e67d13c into webpack-contrib:master Jul 25, 2016
@hemanth
Copy link
Contributor

hemanth commented Jul 25, 2016

Done. @d3viant0ne COVERALLS setup is not up yet.

@hemanth
Copy link
Contributor

hemanth commented Jul 25, 2016

@akesser TypeError: Cannot read property 'hash' of undefined failing the test.

@akesser
Copy link
Contributor Author

akesser commented Dec 30, 2016

I updated my index.js file to pass the nom test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants