From 80a904e12517b1d594f6dab0f7bd14be2dbe6158 Mon Sep 17 00:00:00 2001 From: Jonas Kruckenberg Date: Sat, 30 Jan 2021 23:38:22 +0100 Subject: [PATCH 1/4] Add missing whitespace to descriptor output --- packages/compiler-sfc/src/templateTransformSrcset.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/compiler-sfc/src/templateTransformSrcset.ts b/packages/compiler-sfc/src/templateTransformSrcset.ts index a667d984e16..e4fa88da35e 100644 --- a/packages/compiler-sfc/src/templateTransformSrcset.ts +++ b/packages/compiler-sfc/src/templateTransformSrcset.ts @@ -132,9 +132,9 @@ export const transformSrcset: NodeTransform = ( } const isNotLast = imageCandidates.length - 1 > index if (descriptor && isNotLast) { - compoundExpression.children.push(` + '${descriptor}, ' + `) + compoundExpression.children.push(` + ' ${descriptor}, ' + `) } else if (descriptor) { - compoundExpression.children.push(` + '${descriptor}'`) + compoundExpression.children.push(` + ' ${descriptor}'`) } else if (isNotLast) { compoundExpression.children.push(` + ', ' + `) } From e0d1c885fde9aa16671778c4342cb266470f7528 Mon Sep 17 00:00:00 2001 From: Jonas Kruckenberg Date: Sun, 31 Jan 2021 15:32:40 +0100 Subject: [PATCH 2/4] Update package.json --- packages/compiler-sfc/package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/compiler-sfc/package.json b/packages/compiler-sfc/package.json index e2fb15a31f7..d361b0de763 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -7,6 +7,9 @@ "files": [ "dist" ], + "scripts": { + "prepare": "npm run build", + }, "buildOptions": { "name": "VueCompilerSFC", "formats": [ From cb892d3061f5986c8065bad51afbea4b132e983c Mon Sep 17 00:00:00 2001 From: JonasKruckenberg Date: Sun, 31 Jan 2021 15:36:40 +0100 Subject: [PATCH 3/4] Revert "Update package.json" This reverts commit e0d1c885fde9aa16671778c4342cb266470f7528. --- packages/compiler-sfc/package.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/compiler-sfc/package.json b/packages/compiler-sfc/package.json index d361b0de763..e2fb15a31f7 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -7,9 +7,6 @@ "files": [ "dist" ], - "scripts": { - "prepare": "npm run build", - }, "buildOptions": { "name": "VueCompilerSFC", "formats": [ From 5d98e288eff47f54873f8e4b68b359f63af53504 Mon Sep 17 00:00:00 2001 From: JonasKruckenberg Date: Mon, 1 Feb 2021 12:58:17 +0100 Subject: [PATCH 4/4] test(srcset): Change snapshot to expect whitespace --- .../templateTransformSrcset.spec.ts.snap | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/compiler-sfc/__tests__/__snapshots__/templateTransformSrcset.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/templateTransformSrcset.spec.ts.snap index 2f057279908..4de55a8df96 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/templateTransformSrcset.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/templateTransformSrcset.spec.ts.snap @@ -6,13 +6,13 @@ import _imports_0 from './logo.png' const _hoisted_1 = _imports_0 -const _hoisted_2 = _imports_0 + '2x' -const _hoisted_3 = _imports_0 + '2x' -const _hoisted_4 = _imports_0 + ', ' + _imports_0 + '2x' -const _hoisted_5 = _imports_0 + '2x, ' + _imports_0 -const _hoisted_6 = _imports_0 + '2x, ' + _imports_0 + '3x' -const _hoisted_7 = _imports_0 + ', ' + _imports_0 + '2x, ' + _imports_0 + '3x' -const _hoisted_8 = \\"/logo.png\\" + ', ' + _imports_0 + '2x' +const _hoisted_2 = _imports_0 + ' 2x' +const _hoisted_3 = _imports_0 + ' 2x' +const _hoisted_4 = _imports_0 + ', ' + _imports_0 + ' 2x' +const _hoisted_5 = _imports_0 + ' 2x, ' + _imports_0 +const _hoisted_6 = _imports_0 + ' 2x, ' + _imports_0 + ' 3x' +const _hoisted_7 = _imports_0 + ', ' + _imports_0 + ' 2x, ' + _imports_0 + ' 3x' +const _hoisted_8 = \\"/logo.png\\" + ', ' + _imports_0 + ' 2x' export function render(_ctx, _cache) { return (_openBlock(), _createBlock(_Fragment, null, [ @@ -124,16 +124,16 @@ import _imports_1 from '/logo.png' const _hoisted_1 = _imports_0 -const _hoisted_2 = _imports_0 + '2x' -const _hoisted_3 = _imports_0 + '2x' -const _hoisted_4 = _imports_0 + ', ' + _imports_0 + '2x' -const _hoisted_5 = _imports_0 + '2x, ' + _imports_0 -const _hoisted_6 = _imports_0 + '2x, ' + _imports_0 + '3x' -const _hoisted_7 = _imports_0 + ', ' + _imports_0 + '2x, ' + _imports_0 + '3x' -const _hoisted_8 = _imports_1 + ', ' + _imports_1 + '2x' -const _hoisted_9 = \\"https://example.com/logo.png\\" + ', ' + \\"https://example.com/logo.png\\" + '2x' -const _hoisted_10 = _imports_1 + ', ' + _imports_0 + '2x' -const _hoisted_11 = \\"data:image/png;base64,i\\" + '1x, ' + \\"data:image/png;base64,i\\" + '2x' +const _hoisted_2 = _imports_0 + ' 2x' +const _hoisted_3 = _imports_0 + ' 2x' +const _hoisted_4 = _imports_0 + ', ' + _imports_0 + ' 2x' +const _hoisted_5 = _imports_0 + ' 2x, ' + _imports_0 +const _hoisted_6 = _imports_0 + ' 2x, ' + _imports_0 + ' 3x' +const _hoisted_7 = _imports_0 + ', ' + _imports_0 + ' 2x, ' + _imports_0 + ' 3x' +const _hoisted_8 = _imports_1 + ', ' + _imports_1 + ' 2x' +const _hoisted_9 = \\"https://example.com/logo.png\\" + ', ' + \\"https://example.com/logo.png\\" + ' 2x' +const _hoisted_10 = _imports_1 + ', ' + _imports_0 + ' 2x' +const _hoisted_11 = \\"data:image/png;base64,i\\" + ' 1x, ' + \\"data:image/png;base64,i\\" + ' 2x' export function render(_ctx, _cache) { return (_openBlock(), _createBlock(_Fragment, null, [