Skip to content

img srcset compiler error. #701

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

Closed
zhe-he opened this issue Mar 9, 2017 · 6 comments
Closed

img srcset compiler error. #701

zhe-he opened this issue Mar 9, 2017 · 6 comments

Comments

@zhe-he
Copy link

zhe-he commented Mar 9, 2017

when i use
<img src="../images/card1.png" srcset="../images/[email protected] 2x,../images/[email protected] 3x" />
in .vue.
it will be compiled
<img src="dist/images/card1.png" srcset="../images/[email protected] 2x,../images/[email protected] 3x" />.
It's not a correct thing to do actually.It should be
<img src="dist/images/card1.png" srcset="dist/images/[email protected] 2x,dist/images/[email protected] 3x" />.

Can add srcset compiler?

@dfdgsdfg
Copy link

Check this out.

vuejs-templates/webpack#396

@kazupon
Copy link
Member

kazupon commented Mar 11, 2017

Close (See the above comment URL)

@kazupon kazupon closed this as completed Mar 11, 2017
@tillkolter
Copy link

tillkolter commented Mar 17, 2017

I think this should not be closed, because there is a demand for this feature.

I ran into the same problem and could not even solve it as proposed in the above comment URL. Error was the following (with no further details):

Syntax Error: Unexpected token (61:18)

I experimented and found out that the .1 .2 notation with numbers was not allowed and I could solve it by using a non-numeric pattern.

But isnt the binding strategy not just a workaround and the pattern that @zhe-he posted what we would expect to work?

@ctoLarsson
Copy link

Definitely should re-open. Any page gets a penalty on Google PageSpeed if not including the 1x size image, while almost all user devices today are 2x. So right now there is no acceptable solution to include images in Vue...

@AndreKR
Copy link

AndreKR commented Aug 23, 2017

Absolutely. There is no reason vue-loader should treat src special but not srcset.

@AndreKR
Copy link

AndreKR commented Aug 24, 2017

I made a PR. (#953)

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

No branches or pull requests

6 participants