@vue/compiler-sfc 3.5.30 → 3.5.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiler-sfc.cjs.js +99 -60
- package/dist/compiler-sfc.esm-browser.js +102 -64
- package/package.json +8 -8
package/dist/compiler-sfc.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-sfc v3.5.
|
|
2
|
+
* @vue/compiler-sfc v3.5.32
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -2082,7 +2082,7 @@ function dedent(s) {
|
|
|
2082
2082
|
|
|
2083
2083
|
function isRelativeUrl(url) {
|
|
2084
2084
|
const firstChar = url.charAt(0);
|
|
2085
|
-
return firstChar === "." || firstChar === "~" || firstChar === "@";
|
|
2085
|
+
return firstChar === "." || firstChar === "~" || firstChar === "@" || firstChar === "#";
|
|
2086
2086
|
}
|
|
2087
2087
|
const externalRE = /^(?:https?:)?\/\//;
|
|
2088
2088
|
function isExternalUrl(url) {
|
|
@@ -2092,6 +2092,13 @@ const dataUrlRE = /^\s*data:/i;
|
|
|
2092
2092
|
function isDataUrl(url) {
|
|
2093
2093
|
return dataUrlRE.test(url);
|
|
2094
2094
|
}
|
|
2095
|
+
function normalizeDecodedImportPath(source) {
|
|
2096
|
+
try {
|
|
2097
|
+
return decodeURIComponent(source);
|
|
2098
|
+
} catch {
|
|
2099
|
+
return source;
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2095
2102
|
function parseUrl(url) {
|
|
2096
2103
|
const firstChar = url.charAt(0);
|
|
2097
2104
|
if (firstChar === "~") {
|
|
@@ -2104,14 +2111,17 @@ function parseUriParts(urlString) {
|
|
|
2104
2111
|
return url.parse(shared.isString(urlString) ? urlString : "", false, true);
|
|
2105
2112
|
}
|
|
2106
2113
|
|
|
2114
|
+
const resourceUrlTagConfig = {
|
|
2115
|
+
video: ["src", "poster"],
|
|
2116
|
+
source: ["src"],
|
|
2117
|
+
img: ["src"],
|
|
2118
|
+
image: ["xlink:href", "href"]
|
|
2119
|
+
};
|
|
2107
2120
|
const defaultAssetUrlOptions = {
|
|
2108
2121
|
base: null,
|
|
2109
2122
|
includeAbsolute: false,
|
|
2110
2123
|
tags: {
|
|
2111
|
-
|
|
2112
|
-
source: ["src"],
|
|
2113
|
-
img: ["src"],
|
|
2114
|
-
image: ["xlink:href", "href"],
|
|
2124
|
+
...resourceUrlTagConfig,
|
|
2115
2125
|
use: ["xlink:href", "href"]
|
|
2116
2126
|
}
|
|
2117
2127
|
};
|
|
@@ -2130,6 +2140,10 @@ const normalizeOptions = (options) => {
|
|
|
2130
2140
|
const createAssetUrlTransformWithOptions = (options) => {
|
|
2131
2141
|
return (node, context) => transformAssetUrl(node, context, options);
|
|
2132
2142
|
};
|
|
2143
|
+
function canTransformHashImport(tag, attrName) {
|
|
2144
|
+
var _a;
|
|
2145
|
+
return !!((_a = resourceUrlTagConfig[tag]) == null ? void 0 : _a.includes(attrName));
|
|
2146
|
+
}
|
|
2133
2147
|
const transformAssetUrl = (node, context, options = defaultAssetUrlOptions) => {
|
|
2134
2148
|
if (node.type === 1) {
|
|
2135
2149
|
if (!node.props.length) {
|
|
@@ -2143,11 +2157,16 @@ const transformAssetUrl = (node, context, options = defaultAssetUrlOptions) => {
|
|
|
2143
2157
|
}
|
|
2144
2158
|
const assetAttrs = (attrs || []).concat(wildCardAttrs || []);
|
|
2145
2159
|
node.props.forEach((attr, index) => {
|
|
2146
|
-
if (attr.type !== 6 || !assetAttrs.includes(attr.name) || !attr.value
|
|
2160
|
+
if (attr.type !== 6 || !assetAttrs.includes(attr.name) || !attr.value) {
|
|
2147
2161
|
return;
|
|
2148
2162
|
}
|
|
2149
|
-
const
|
|
2150
|
-
|
|
2163
|
+
const urlValue = attr.value.content;
|
|
2164
|
+
const isHashOnlyValue = urlValue[0] === "#";
|
|
2165
|
+
if (isExternalUrl(urlValue) || isDataUrl(urlValue) || isHashOnlyValue && !canTransformHashImport(node.tag, attr.name) || !options.includeAbsolute && !isRelativeUrl(urlValue)) {
|
|
2166
|
+
return;
|
|
2167
|
+
}
|
|
2168
|
+
const url = parseUrl(urlValue);
|
|
2169
|
+
if (options.base && urlValue[0] === ".") {
|
|
2151
2170
|
const base = parseUrl(options.base);
|
|
2152
2171
|
const protocol = base.protocol || "";
|
|
2153
2172
|
const host = base.host ? protocol + "//" + base.host : "";
|
|
@@ -2167,55 +2186,65 @@ const transformAssetUrl = (node, context, options = defaultAssetUrlOptions) => {
|
|
|
2167
2186
|
});
|
|
2168
2187
|
}
|
|
2169
2188
|
};
|
|
2189
|
+
function resolveOrRegisterImport(source, loc, context) {
|
|
2190
|
+
const normalizedSource = normalizeDecodedImportPath(source);
|
|
2191
|
+
const existingIndex = context.imports.findIndex(
|
|
2192
|
+
(i) => i.path === normalizedSource
|
|
2193
|
+
);
|
|
2194
|
+
if (existingIndex > -1) {
|
|
2195
|
+
return {
|
|
2196
|
+
name: `_imports_${existingIndex}`,
|
|
2197
|
+
exp: context.imports[existingIndex].exp
|
|
2198
|
+
};
|
|
2199
|
+
}
|
|
2200
|
+
const name = `_imports_${context.imports.length}`;
|
|
2201
|
+
const exp = compilerCore.createSimpleExpression(
|
|
2202
|
+
name,
|
|
2203
|
+
false,
|
|
2204
|
+
loc,
|
|
2205
|
+
3
|
|
2206
|
+
);
|
|
2207
|
+
context.imports.push({
|
|
2208
|
+
exp,
|
|
2209
|
+
path: normalizedSource
|
|
2210
|
+
});
|
|
2211
|
+
return { name, exp };
|
|
2212
|
+
}
|
|
2170
2213
|
function getImportsExpressionExp(path2, hash, loc, context) {
|
|
2171
|
-
if (path2) {
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2214
|
+
if (!path2 && !hash) {
|
|
2215
|
+
return compilerCore.createSimpleExpression(`''`, false, loc, 3);
|
|
2216
|
+
}
|
|
2217
|
+
if (!path2 && hash) {
|
|
2218
|
+
const { exp } = resolveOrRegisterImport(hash, loc, context);
|
|
2219
|
+
return exp;
|
|
2220
|
+
}
|
|
2221
|
+
if (path2 && !hash) {
|
|
2222
|
+
const { exp } = resolveOrRegisterImport(path2, loc, context);
|
|
2223
|
+
return exp;
|
|
2224
|
+
}
|
|
2225
|
+
const { name } = resolveOrRegisterImport(path2, loc, context);
|
|
2226
|
+
const hashExp = `${name} + '${hash}'`;
|
|
2227
|
+
const finalExp = compilerCore.createSimpleExpression(
|
|
2228
|
+
hashExp,
|
|
2229
|
+
false,
|
|
2230
|
+
loc,
|
|
2231
|
+
3
|
|
2232
|
+
);
|
|
2233
|
+
if (!context.hoistStatic) {
|
|
2234
|
+
return finalExp;
|
|
2235
|
+
}
|
|
2236
|
+
const existingHoistIndex = context.hoists.findIndex((h) => {
|
|
2237
|
+
return h && h.type === 4 && !h.isStatic && h.content === hashExp;
|
|
2238
|
+
});
|
|
2239
|
+
if (existingHoistIndex > -1) {
|
|
2240
|
+
return compilerCore.createSimpleExpression(
|
|
2241
|
+
`_hoisted_${existingHoistIndex + 1}`,
|
|
2197
2242
|
false,
|
|
2198
2243
|
loc,
|
|
2199
2244
|
3
|
|
2200
2245
|
);
|
|
2201
|
-
if (!context.hoistStatic) {
|
|
2202
|
-
return finalExp;
|
|
2203
|
-
}
|
|
2204
|
-
const existingHoistIndex = context.hoists.findIndex((h) => {
|
|
2205
|
-
return h && h.type === 4 && !h.isStatic && h.content === hashExp;
|
|
2206
|
-
});
|
|
2207
|
-
if (existingHoistIndex > -1) {
|
|
2208
|
-
return compilerCore.createSimpleExpression(
|
|
2209
|
-
`_hoisted_${existingHoistIndex + 1}`,
|
|
2210
|
-
false,
|
|
2211
|
-
loc,
|
|
2212
|
-
3
|
|
2213
|
-
);
|
|
2214
|
-
}
|
|
2215
|
-
return context.hoist(finalExp);
|
|
2216
|
-
} else {
|
|
2217
|
-
return compilerCore.createSimpleExpression(`''`, false, loc, 3);
|
|
2218
2246
|
}
|
|
2247
|
+
return context.hoist(finalExp);
|
|
2219
2248
|
}
|
|
2220
2249
|
|
|
2221
2250
|
const srcsetTags = ["img", "source"];
|
|
@@ -2272,12 +2301,14 @@ const transformSrcset = (node, context, options = defaultAssetUrlOptions) => {
|
|
|
2272
2301
|
const compoundExpression = compilerCore.createCompoundExpression([], attr.loc);
|
|
2273
2302
|
imageCandidates.forEach(({ url, descriptor }, index2) => {
|
|
2274
2303
|
if (shouldProcessUrl(url)) {
|
|
2275
|
-
const { path: path2 } = parseUrl(url);
|
|
2276
|
-
|
|
2277
|
-
if (
|
|
2304
|
+
const { path: path2, hash } = parseUrl(url);
|
|
2305
|
+
const source = path2 ? path2 : hash;
|
|
2306
|
+
if (source) {
|
|
2307
|
+
const normalizedSource = normalizeDecodedImportPath(source);
|
|
2278
2308
|
const existingImportsIndex = context.imports.findIndex(
|
|
2279
|
-
(i) => i.path ===
|
|
2309
|
+
(i) => i.path === normalizedSource
|
|
2280
2310
|
);
|
|
2311
|
+
let exp2;
|
|
2281
2312
|
if (existingImportsIndex > -1) {
|
|
2282
2313
|
exp2 = compilerCore.createSimpleExpression(
|
|
2283
2314
|
`_imports_${existingImportsIndex}`,
|
|
@@ -2292,7 +2323,15 @@ const transformSrcset = (node, context, options = defaultAssetUrlOptions) => {
|
|
|
2292
2323
|
attr.loc,
|
|
2293
2324
|
3
|
|
2294
2325
|
);
|
|
2295
|
-
context.imports.push({ exp: exp2, path:
|
|
2326
|
+
context.imports.push({ exp: exp2, path: normalizedSource });
|
|
2327
|
+
}
|
|
2328
|
+
if (path2 && hash) {
|
|
2329
|
+
exp2 = compilerCore.createSimpleExpression(
|
|
2330
|
+
`${exp2.content} + '${hash}'`,
|
|
2331
|
+
false,
|
|
2332
|
+
attr.loc,
|
|
2333
|
+
3
|
|
2334
|
+
);
|
|
2296
2335
|
}
|
|
2297
2336
|
compoundExpression.children.push(exp2);
|
|
2298
2337
|
}
|
|
@@ -23906,9 +23945,9 @@ function processDefineModel(ctx, node, declId) {
|
|
|
23906
23945
|
let modelName;
|
|
23907
23946
|
let options;
|
|
23908
23947
|
const arg0 = node.arguments[0] && CompilerDOM.unwrapTSNode(node.arguments[0]);
|
|
23909
|
-
const hasName = arg0 && arg0.type === "StringLiteral";
|
|
23948
|
+
const hasName = arg0 && (arg0.type === "StringLiteral" || arg0.type === "TemplateLiteral" && arg0.expressions.length === 0);
|
|
23910
23949
|
if (hasName) {
|
|
23911
|
-
modelName = arg0.value;
|
|
23950
|
+
modelName = arg0.type === "StringLiteral" ? arg0.value : arg0.quasis[0].value.cooked;
|
|
23912
23951
|
options = node.arguments[1];
|
|
23913
23952
|
} else {
|
|
23914
23953
|
modelName = "modelValue";
|
|
@@ -25544,7 +25583,7 @@ function mergeSourceMaps(scriptMap, templateMap, templateLineOffset) {
|
|
|
25544
25583
|
return generator.toJSON();
|
|
25545
25584
|
}
|
|
25546
25585
|
|
|
25547
|
-
const version = "3.5.
|
|
25586
|
+
const version = "3.5.32";
|
|
25548
25587
|
const parseCache = parseCache$1;
|
|
25549
25588
|
const errorMessages = {
|
|
25550
25589
|
...CompilerDOM.errorMessages,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-sfc v3.5.
|
|
2
|
+
* @vue/compiler-sfc v3.5.32
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -15949,7 +15949,7 @@ function requireLib () {
|
|
|
15949
15949
|
this.next();
|
|
15950
15950
|
return this.parseAsyncFunctionExpression(this.startNodeAtNode(id));
|
|
15951
15951
|
} else if (tokenIsIdentifier(type)) {
|
|
15952
|
-
if (this.lookaheadCharCode() === 61) {
|
|
15952
|
+
if (canBeArrow && this.lookaheadCharCode() === 61) {
|
|
15953
15953
|
return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id));
|
|
15954
15954
|
} else {
|
|
15955
15955
|
return id;
|
|
@@ -26096,7 +26096,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
26096
26096
|
loop.body = createBlockStatement([
|
|
26097
26097
|
createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
|
|
26098
26098
|
createCompoundExpression([
|
|
26099
|
-
`if (_cached`,
|
|
26099
|
+
`if (_cached && _cached.el`,
|
|
26100
26100
|
...keyExp ? [` && _cached.key === `, keyExp] : [],
|
|
26101
26101
|
` && ${context.helperString(
|
|
26102
26102
|
IS_MEMO_SAME
|
|
@@ -31697,7 +31697,7 @@ var _polyfillNode_url$1 = /*#__PURE__*/Object.freeze({
|
|
|
31697
31697
|
|
|
31698
31698
|
function isRelativeUrl(url) {
|
|
31699
31699
|
const firstChar = url.charAt(0);
|
|
31700
|
-
return firstChar === "." || firstChar === "~" || firstChar === "@";
|
|
31700
|
+
return firstChar === "." || firstChar === "~" || firstChar === "@" || firstChar === "#";
|
|
31701
31701
|
}
|
|
31702
31702
|
const externalRE = /^(?:https?:)?\/\//;
|
|
31703
31703
|
function isExternalUrl(url) {
|
|
@@ -31707,6 +31707,13 @@ const dataUrlRE = /^\s*data:/i;
|
|
|
31707
31707
|
function isDataUrl(url) {
|
|
31708
31708
|
return dataUrlRE.test(url);
|
|
31709
31709
|
}
|
|
31710
|
+
function normalizeDecodedImportPath(source) {
|
|
31711
|
+
try {
|
|
31712
|
+
return decodeURIComponent(source);
|
|
31713
|
+
} catch (e) {
|
|
31714
|
+
return source;
|
|
31715
|
+
}
|
|
31716
|
+
}
|
|
31710
31717
|
function parseUrl(url) {
|
|
31711
31718
|
const firstChar = url.charAt(0);
|
|
31712
31719
|
if (firstChar === "~") {
|
|
@@ -31738,16 +31745,18 @@ var __spreadValues$9 = (a, b) => {
|
|
|
31738
31745
|
return a;
|
|
31739
31746
|
};
|
|
31740
31747
|
var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
|
31748
|
+
const resourceUrlTagConfig = {
|
|
31749
|
+
video: ["src", "poster"],
|
|
31750
|
+
source: ["src"],
|
|
31751
|
+
img: ["src"],
|
|
31752
|
+
image: ["xlink:href", "href"]
|
|
31753
|
+
};
|
|
31741
31754
|
const defaultAssetUrlOptions = {
|
|
31742
31755
|
base: null,
|
|
31743
31756
|
includeAbsolute: false,
|
|
31744
|
-
tags: {
|
|
31745
|
-
video: ["src", "poster"],
|
|
31746
|
-
source: ["src"],
|
|
31747
|
-
img: ["src"],
|
|
31748
|
-
image: ["xlink:href", "href"],
|
|
31757
|
+
tags: __spreadProps$8(__spreadValues$9({}, resourceUrlTagConfig), {
|
|
31749
31758
|
use: ["xlink:href", "href"]
|
|
31750
|
-
}
|
|
31759
|
+
})
|
|
31751
31760
|
};
|
|
31752
31761
|
const normalizeOptions = (options) => {
|
|
31753
31762
|
if (Object.keys(options).some((key) => isArray$3(options[key]))) {
|
|
@@ -31760,6 +31769,10 @@ const normalizeOptions = (options) => {
|
|
|
31760
31769
|
const createAssetUrlTransformWithOptions = (options) => {
|
|
31761
31770
|
return (node, context) => transformAssetUrl(node, context, options);
|
|
31762
31771
|
};
|
|
31772
|
+
function canTransformHashImport(tag, attrName) {
|
|
31773
|
+
var _a;
|
|
31774
|
+
return !!((_a = resourceUrlTagConfig[tag]) == null ? void 0 : _a.includes(attrName));
|
|
31775
|
+
}
|
|
31763
31776
|
const transformAssetUrl = (node, context, options = defaultAssetUrlOptions) => {
|
|
31764
31777
|
if (node.type === 1) {
|
|
31765
31778
|
if (!node.props.length) {
|
|
@@ -31773,11 +31786,16 @@ const transformAssetUrl = (node, context, options = defaultAssetUrlOptions) => {
|
|
|
31773
31786
|
}
|
|
31774
31787
|
const assetAttrs = (attrs || []).concat(wildCardAttrs || []);
|
|
31775
31788
|
node.props.forEach((attr, index) => {
|
|
31776
|
-
if (attr.type !== 6 || !assetAttrs.includes(attr.name) || !attr.value
|
|
31789
|
+
if (attr.type !== 6 || !assetAttrs.includes(attr.name) || !attr.value) {
|
|
31790
|
+
return;
|
|
31791
|
+
}
|
|
31792
|
+
const urlValue = attr.value.content;
|
|
31793
|
+
const isHashOnlyValue = urlValue[0] === "#";
|
|
31794
|
+
if (isExternalUrl(urlValue) || isDataUrl(urlValue) || isHashOnlyValue && !canTransformHashImport(node.tag, attr.name) || !options.includeAbsolute && !isRelativeUrl(urlValue)) {
|
|
31777
31795
|
return;
|
|
31778
31796
|
}
|
|
31779
|
-
const url = parseUrl(
|
|
31780
|
-
if (options.base &&
|
|
31797
|
+
const url = parseUrl(urlValue);
|
|
31798
|
+
if (options.base && urlValue[0] === ".") {
|
|
31781
31799
|
const base = parseUrl(options.base);
|
|
31782
31800
|
const protocol = base.protocol || "";
|
|
31783
31801
|
const host = base.host ? protocol + "//" + base.host : "";
|
|
@@ -31797,55 +31815,65 @@ const transformAssetUrl = (node, context, options = defaultAssetUrlOptions) => {
|
|
|
31797
31815
|
});
|
|
31798
31816
|
}
|
|
31799
31817
|
};
|
|
31818
|
+
function resolveOrRegisterImport(source, loc, context) {
|
|
31819
|
+
const normalizedSource = normalizeDecodedImportPath(source);
|
|
31820
|
+
const existingIndex = context.imports.findIndex(
|
|
31821
|
+
(i) => i.path === normalizedSource
|
|
31822
|
+
);
|
|
31823
|
+
if (existingIndex > -1) {
|
|
31824
|
+
return {
|
|
31825
|
+
name: `_imports_${existingIndex}`,
|
|
31826
|
+
exp: context.imports[existingIndex].exp
|
|
31827
|
+
};
|
|
31828
|
+
}
|
|
31829
|
+
const name = `_imports_${context.imports.length}`;
|
|
31830
|
+
const exp = createSimpleExpression(
|
|
31831
|
+
name,
|
|
31832
|
+
false,
|
|
31833
|
+
loc,
|
|
31834
|
+
3
|
|
31835
|
+
);
|
|
31836
|
+
context.imports.push({
|
|
31837
|
+
exp,
|
|
31838
|
+
path: normalizedSource
|
|
31839
|
+
});
|
|
31840
|
+
return { name, exp };
|
|
31841
|
+
}
|
|
31800
31842
|
function getImportsExpressionExp(path2, hash, loc, context) {
|
|
31801
|
-
if (path2) {
|
|
31802
|
-
|
|
31803
|
-
|
|
31804
|
-
|
|
31805
|
-
|
|
31806
|
-
|
|
31807
|
-
|
|
31808
|
-
|
|
31809
|
-
|
|
31810
|
-
|
|
31811
|
-
|
|
31812
|
-
|
|
31813
|
-
|
|
31814
|
-
|
|
31815
|
-
|
|
31816
|
-
|
|
31817
|
-
|
|
31818
|
-
|
|
31819
|
-
|
|
31820
|
-
|
|
31821
|
-
|
|
31822
|
-
|
|
31823
|
-
|
|
31824
|
-
|
|
31825
|
-
|
|
31826
|
-
|
|
31843
|
+
if (!path2 && !hash) {
|
|
31844
|
+
return createSimpleExpression(`''`, false, loc, 3);
|
|
31845
|
+
}
|
|
31846
|
+
if (!path2 && hash) {
|
|
31847
|
+
const { exp } = resolveOrRegisterImport(hash, loc, context);
|
|
31848
|
+
return exp;
|
|
31849
|
+
}
|
|
31850
|
+
if (path2 && !hash) {
|
|
31851
|
+
const { exp } = resolveOrRegisterImport(path2, loc, context);
|
|
31852
|
+
return exp;
|
|
31853
|
+
}
|
|
31854
|
+
const { name } = resolveOrRegisterImport(path2, loc, context);
|
|
31855
|
+
const hashExp = `${name} + '${hash}'`;
|
|
31856
|
+
const finalExp = createSimpleExpression(
|
|
31857
|
+
hashExp,
|
|
31858
|
+
false,
|
|
31859
|
+
loc,
|
|
31860
|
+
3
|
|
31861
|
+
);
|
|
31862
|
+
if (!context.hoistStatic) {
|
|
31863
|
+
return finalExp;
|
|
31864
|
+
}
|
|
31865
|
+
const existingHoistIndex = context.hoists.findIndex((h) => {
|
|
31866
|
+
return h && h.type === 4 && !h.isStatic && h.content === hashExp;
|
|
31867
|
+
});
|
|
31868
|
+
if (existingHoistIndex > -1) {
|
|
31869
|
+
return createSimpleExpression(
|
|
31870
|
+
`_hoisted_${existingHoistIndex + 1}`,
|
|
31827
31871
|
false,
|
|
31828
31872
|
loc,
|
|
31829
31873
|
3
|
|
31830
31874
|
);
|
|
31831
|
-
if (!context.hoistStatic) {
|
|
31832
|
-
return finalExp;
|
|
31833
|
-
}
|
|
31834
|
-
const existingHoistIndex = context.hoists.findIndex((h) => {
|
|
31835
|
-
return h && h.type === 4 && !h.isStatic && h.content === hashExp;
|
|
31836
|
-
});
|
|
31837
|
-
if (existingHoistIndex > -1) {
|
|
31838
|
-
return createSimpleExpression(
|
|
31839
|
-
`_hoisted_${existingHoistIndex + 1}`,
|
|
31840
|
-
false,
|
|
31841
|
-
loc,
|
|
31842
|
-
3
|
|
31843
|
-
);
|
|
31844
|
-
}
|
|
31845
|
-
return context.hoist(finalExp);
|
|
31846
|
-
} else {
|
|
31847
|
-
return createSimpleExpression(`''`, false, loc, 3);
|
|
31848
31875
|
}
|
|
31876
|
+
return context.hoist(finalExp);
|
|
31849
31877
|
}
|
|
31850
31878
|
|
|
31851
31879
|
const srcsetTags = ["img", "source"];
|
|
@@ -31902,12 +31930,14 @@ const transformSrcset = (node, context, options = defaultAssetUrlOptions) => {
|
|
|
31902
31930
|
const compoundExpression = createCompoundExpression([], attr.loc);
|
|
31903
31931
|
imageCandidates.forEach(({ url, descriptor }, index2) => {
|
|
31904
31932
|
if (shouldProcessUrl(url)) {
|
|
31905
|
-
const { path: path2 } = parseUrl(url);
|
|
31906
|
-
|
|
31907
|
-
if (
|
|
31933
|
+
const { path: path2, hash } = parseUrl(url);
|
|
31934
|
+
const source = path2 ? path2 : hash;
|
|
31935
|
+
if (source) {
|
|
31936
|
+
const normalizedSource = normalizeDecodedImportPath(source);
|
|
31908
31937
|
const existingImportsIndex = context.imports.findIndex(
|
|
31909
|
-
(i) => i.path ===
|
|
31938
|
+
(i) => i.path === normalizedSource
|
|
31910
31939
|
);
|
|
31940
|
+
let exp2;
|
|
31911
31941
|
if (existingImportsIndex > -1) {
|
|
31912
31942
|
exp2 = createSimpleExpression(
|
|
31913
31943
|
`_imports_${existingImportsIndex}`,
|
|
@@ -31922,7 +31952,15 @@ const transformSrcset = (node, context, options = defaultAssetUrlOptions) => {
|
|
|
31922
31952
|
attr.loc,
|
|
31923
31953
|
3
|
|
31924
31954
|
);
|
|
31925
|
-
context.imports.push({ exp: exp2, path:
|
|
31955
|
+
context.imports.push({ exp: exp2, path: normalizedSource });
|
|
31956
|
+
}
|
|
31957
|
+
if (path2 && hash) {
|
|
31958
|
+
exp2 = createSimpleExpression(
|
|
31959
|
+
`${exp2.content} + '${hash}'`,
|
|
31960
|
+
false,
|
|
31961
|
+
attr.loc,
|
|
31962
|
+
3
|
|
31963
|
+
);
|
|
31926
31964
|
}
|
|
31927
31965
|
compoundExpression.children.push(exp2);
|
|
31928
31966
|
}
|
|
@@ -49117,9 +49155,9 @@ function processDefineModel(ctx, node, declId) {
|
|
|
49117
49155
|
let modelName;
|
|
49118
49156
|
let options;
|
|
49119
49157
|
const arg0 = node.arguments[0] && unwrapTSNode(node.arguments[0]);
|
|
49120
|
-
const hasName = arg0 && arg0.type === "StringLiteral";
|
|
49158
|
+
const hasName = arg0 && (arg0.type === "StringLiteral" || arg0.type === "TemplateLiteral" && arg0.expressions.length === 0);
|
|
49121
49159
|
if (hasName) {
|
|
49122
|
-
modelName = arg0.value;
|
|
49160
|
+
modelName = arg0.type === "StringLiteral" ? arg0.value : arg0.quasis[0].value.cooked;
|
|
49123
49161
|
options = node.arguments[1];
|
|
49124
49162
|
} else {
|
|
49125
49163
|
modelName = "modelValue";
|
|
@@ -50785,7 +50823,7 @@ var __spreadValues = (a, b) => {
|
|
|
50785
50823
|
}
|
|
50786
50824
|
return a;
|
|
50787
50825
|
};
|
|
50788
|
-
const version = "3.5.
|
|
50826
|
+
const version = "3.5.32";
|
|
50789
50827
|
const parseCache = parseCache$1;
|
|
50790
50828
|
const errorMessages = __spreadValues(__spreadValues({}, errorMessages$1), DOMErrorMessages);
|
|
50791
50829
|
const walk = walk$2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/compiler-sfc",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.32",
|
|
4
4
|
"description": "@vue/compiler-sfc",
|
|
5
5
|
"main": "dist/compiler-sfc.cjs.js",
|
|
6
6
|
"module": "dist/compiler-sfc.esm-browser.js",
|
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
},
|
|
43
43
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-sfc#readme",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@babel/parser": "^7.29.
|
|
45
|
+
"@babel/parser": "^7.29.2",
|
|
46
46
|
"estree-walker": "^2.0.2",
|
|
47
47
|
"magic-string": "^0.30.21",
|
|
48
48
|
"postcss": "^8.5.8",
|
|
49
49
|
"source-map-js": "^1.2.1",
|
|
50
|
-
"@vue/compiler-
|
|
51
|
-
"@vue/compiler-
|
|
52
|
-
"@vue/compiler-ssr": "3.5.
|
|
53
|
-
"@vue/shared": "3.5.
|
|
50
|
+
"@vue/compiler-core": "3.5.32",
|
|
51
|
+
"@vue/compiler-dom": "3.5.32",
|
|
52
|
+
"@vue/compiler-ssr": "3.5.32",
|
|
53
|
+
"@vue/shared": "3.5.32"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@babel/types": "^7.29.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"minimatch": "~10.2.4",
|
|
62
62
|
"postcss-modules": "^6.0.1",
|
|
63
63
|
"postcss-selector-parser": "^7.1.1",
|
|
64
|
-
"pug": "^3.0.
|
|
65
|
-
"sass": "^1.
|
|
64
|
+
"pug": "^3.0.4",
|
|
65
|
+
"sass": "^1.98.0"
|
|
66
66
|
}
|
|
67
67
|
}
|