fix(compiler-sfc): compiler blank srcset (#3005)

fix https://github.com/vitejs/vite/issues/1523
This commit is contained in:
underfin
2021-02-04 02:27:34 +08:00
committed by GitHub
parent ffd5288545
commit 9dc816d634
3 changed files with 14 additions and 1 deletions

View File

@@ -46,7 +46,7 @@ export const transformSrcset: NodeTransform = (
if (attr.name === 'srcset' && attr.type === NodeTypes.ATTRIBUTE) {
if (!attr.value) return
const value = attr.value.content
if (!value) return
const imageCandidates: ImageCandidate[] = value.split(',').map(s => {
// The attribute value arrives here with all whitespace, except
// normal spaces, represented by escape sequences