@forsakringskassan/vite-lib-config 4.8.1 → 4.9.0
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/vite.config.cjs +163 -180
- package/dist/vite.config.mjs +163 -180
- package/package.json +2 -2
package/dist/vite.config.cjs
CHANGED
|
@@ -288,18 +288,18 @@ var require_uFuzzy = __commonJS({
|
|
|
288
288
|
return [new RegExp(reTpl, "i" + uFlag), parts, contrs];
|
|
289
289
|
};
|
|
290
290
|
const filter2 = (haystack, needle, idxs) => {
|
|
291
|
-
let [
|
|
292
|
-
if (
|
|
291
|
+
let [query2] = prepQuery(needle);
|
|
292
|
+
if (query2 == null)
|
|
293
293
|
return null;
|
|
294
294
|
let out = [];
|
|
295
295
|
if (idxs != null) {
|
|
296
296
|
for (let i = 0; i < idxs.length; i++) {
|
|
297
297
|
let idx = idxs[i];
|
|
298
|
-
|
|
298
|
+
query2.test(haystack[idx]) && out.push(idx);
|
|
299
299
|
}
|
|
300
300
|
} else {
|
|
301
301
|
for (let i = 0; i < haystack.length; i++)
|
|
302
|
-
|
|
302
|
+
query2.test(haystack[i]) && out.push(i);
|
|
303
303
|
}
|
|
304
304
|
return out;
|
|
305
305
|
};
|
|
@@ -307,7 +307,7 @@ var require_uFuzzy = __commonJS({
|
|
|
307
307
|
let interBound = new RegExp(_interBound, uFlag);
|
|
308
308
|
let intraBound = new RegExp(_intraBound, uFlag);
|
|
309
309
|
const info = (idxs, haystack, needle) => {
|
|
310
|
-
let [
|
|
310
|
+
let [query2, parts, contrs] = prepQuery(needle, 1);
|
|
311
311
|
let partsCased = split(needle, true);
|
|
312
312
|
let [queryR] = prepQuery(needle, 2);
|
|
313
313
|
let partsLen = parts.length;
|
|
@@ -353,7 +353,7 @@ var require_uFuzzy = __commonJS({
|
|
|
353
353
|
let ii2 = 0;
|
|
354
354
|
for (let i = 0; i < idxs.length; i++) {
|
|
355
355
|
let mhstr = haystack[idxs[i]];
|
|
356
|
-
let m = mhstr.match(
|
|
356
|
+
let m = mhstr.match(query2);
|
|
357
357
|
let start = m.index + m[1].length;
|
|
358
358
|
let idxAcc = start;
|
|
359
359
|
let disc = false;
|
|
@@ -1226,8 +1226,8 @@ var require_scan = __commonJS({
|
|
|
1226
1226
|
CHAR_RIGHT_SQUARE_BRACKET
|
|
1227
1227
|
/* ] */
|
|
1228
1228
|
} = require_constants();
|
|
1229
|
-
var isPathSeparator = (
|
|
1230
|
-
return
|
|
1229
|
+
var isPathSeparator = (code2) => {
|
|
1230
|
+
return code2 === CHAR_FORWARD_SLASH || code2 === CHAR_BACKWARD_SLASH;
|
|
1231
1231
|
};
|
|
1232
1232
|
var depth = (token) => {
|
|
1233
1233
|
if (token.isPrefix !== true) {
|
|
@@ -1257,38 +1257,38 @@ var require_scan = __commonJS({
|
|
|
1257
1257
|
let finished = false;
|
|
1258
1258
|
let braces = 0;
|
|
1259
1259
|
let prev;
|
|
1260
|
-
let
|
|
1260
|
+
let code2;
|
|
1261
1261
|
let token = { value: "", depth: 0, isGlob: false };
|
|
1262
1262
|
const eos = () => index >= length;
|
|
1263
1263
|
const peek = () => str.charCodeAt(index + 1);
|
|
1264
1264
|
const advance = () => {
|
|
1265
|
-
prev =
|
|
1265
|
+
prev = code2;
|
|
1266
1266
|
return str.charCodeAt(++index);
|
|
1267
1267
|
};
|
|
1268
1268
|
while (index < length) {
|
|
1269
|
-
|
|
1269
|
+
code2 = advance();
|
|
1270
1270
|
let next;
|
|
1271
|
-
if (
|
|
1271
|
+
if (code2 === CHAR_BACKWARD_SLASH) {
|
|
1272
1272
|
backslashes = token.backslashes = true;
|
|
1273
|
-
|
|
1274
|
-
if (
|
|
1273
|
+
code2 = advance();
|
|
1274
|
+
if (code2 === CHAR_LEFT_CURLY_BRACE) {
|
|
1275
1275
|
braceEscaped = true;
|
|
1276
1276
|
}
|
|
1277
1277
|
continue;
|
|
1278
1278
|
}
|
|
1279
|
-
if (braceEscaped === true ||
|
|
1279
|
+
if (braceEscaped === true || code2 === CHAR_LEFT_CURLY_BRACE) {
|
|
1280
1280
|
braces++;
|
|
1281
|
-
while (eos() !== true && (
|
|
1282
|
-
if (
|
|
1281
|
+
while (eos() !== true && (code2 = advance())) {
|
|
1282
|
+
if (code2 === CHAR_BACKWARD_SLASH) {
|
|
1283
1283
|
backslashes = token.backslashes = true;
|
|
1284
1284
|
advance();
|
|
1285
1285
|
continue;
|
|
1286
1286
|
}
|
|
1287
|
-
if (
|
|
1287
|
+
if (code2 === CHAR_LEFT_CURLY_BRACE) {
|
|
1288
1288
|
braces++;
|
|
1289
1289
|
continue;
|
|
1290
1290
|
}
|
|
1291
|
-
if (braceEscaped !== true &&
|
|
1291
|
+
if (braceEscaped !== true && code2 === CHAR_DOT && (code2 = advance()) === CHAR_DOT) {
|
|
1292
1292
|
isBrace = token.isBrace = true;
|
|
1293
1293
|
isGlob = token.isGlob = true;
|
|
1294
1294
|
finished = true;
|
|
@@ -1297,7 +1297,7 @@ var require_scan = __commonJS({
|
|
|
1297
1297
|
}
|
|
1298
1298
|
break;
|
|
1299
1299
|
}
|
|
1300
|
-
if (braceEscaped !== true &&
|
|
1300
|
+
if (braceEscaped !== true && code2 === CHAR_COMMA) {
|
|
1301
1301
|
isBrace = token.isBrace = true;
|
|
1302
1302
|
isGlob = token.isGlob = true;
|
|
1303
1303
|
finished = true;
|
|
@@ -1306,7 +1306,7 @@ var require_scan = __commonJS({
|
|
|
1306
1306
|
}
|
|
1307
1307
|
break;
|
|
1308
1308
|
}
|
|
1309
|
-
if (
|
|
1309
|
+
if (code2 === CHAR_RIGHT_CURLY_BRACE) {
|
|
1310
1310
|
braces--;
|
|
1311
1311
|
if (braces === 0) {
|
|
1312
1312
|
braceEscaped = false;
|
|
@@ -1321,7 +1321,7 @@ var require_scan = __commonJS({
|
|
|
1321
1321
|
}
|
|
1322
1322
|
break;
|
|
1323
1323
|
}
|
|
1324
|
-
if (
|
|
1324
|
+
if (code2 === CHAR_FORWARD_SLASH) {
|
|
1325
1325
|
slashes.push(index);
|
|
1326
1326
|
tokens.push(token);
|
|
1327
1327
|
token = { value: "", depth: 0, isGlob: false };
|
|
@@ -1334,22 +1334,22 @@ var require_scan = __commonJS({
|
|
|
1334
1334
|
continue;
|
|
1335
1335
|
}
|
|
1336
1336
|
if (opts.noext !== true) {
|
|
1337
|
-
const isExtglobChar =
|
|
1337
|
+
const isExtglobChar = code2 === CHAR_PLUS || code2 === CHAR_AT || code2 === CHAR_ASTERISK || code2 === CHAR_QUESTION_MARK || code2 === CHAR_EXCLAMATION_MARK;
|
|
1338
1338
|
if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
|
|
1339
1339
|
isGlob = token.isGlob = true;
|
|
1340
1340
|
isExtglob = token.isExtglob = true;
|
|
1341
1341
|
finished = true;
|
|
1342
|
-
if (
|
|
1342
|
+
if (code2 === CHAR_EXCLAMATION_MARK && index === start) {
|
|
1343
1343
|
negatedExtglob = true;
|
|
1344
1344
|
}
|
|
1345
1345
|
if (scanToEnd === true) {
|
|
1346
|
-
while (eos() !== true && (
|
|
1347
|
-
if (
|
|
1346
|
+
while (eos() !== true && (code2 = advance())) {
|
|
1347
|
+
if (code2 === CHAR_BACKWARD_SLASH) {
|
|
1348
1348
|
backslashes = token.backslashes = true;
|
|
1349
|
-
|
|
1349
|
+
code2 = advance();
|
|
1350
1350
|
continue;
|
|
1351
1351
|
}
|
|
1352
|
-
if (
|
|
1352
|
+
if (code2 === CHAR_RIGHT_PARENTHESES) {
|
|
1353
1353
|
isGlob = token.isGlob = true;
|
|
1354
1354
|
finished = true;
|
|
1355
1355
|
break;
|
|
@@ -1360,7 +1360,7 @@ var require_scan = __commonJS({
|
|
|
1360
1360
|
break;
|
|
1361
1361
|
}
|
|
1362
1362
|
}
|
|
1363
|
-
if (
|
|
1363
|
+
if (code2 === CHAR_ASTERISK) {
|
|
1364
1364
|
if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
|
|
1365
1365
|
isGlob = token.isGlob = true;
|
|
1366
1366
|
finished = true;
|
|
@@ -1369,7 +1369,7 @@ var require_scan = __commonJS({
|
|
|
1369
1369
|
}
|
|
1370
1370
|
break;
|
|
1371
1371
|
}
|
|
1372
|
-
if (
|
|
1372
|
+
if (code2 === CHAR_QUESTION_MARK) {
|
|
1373
1373
|
isGlob = token.isGlob = true;
|
|
1374
1374
|
finished = true;
|
|
1375
1375
|
if (scanToEnd === true) {
|
|
@@ -1377,7 +1377,7 @@ var require_scan = __commonJS({
|
|
|
1377
1377
|
}
|
|
1378
1378
|
break;
|
|
1379
1379
|
}
|
|
1380
|
-
if (
|
|
1380
|
+
if (code2 === CHAR_LEFT_SQUARE_BRACKET) {
|
|
1381
1381
|
while (eos() !== true && (next = advance())) {
|
|
1382
1382
|
if (next === CHAR_BACKWARD_SLASH) {
|
|
1383
1383
|
backslashes = token.backslashes = true;
|
|
@@ -1396,21 +1396,21 @@ var require_scan = __commonJS({
|
|
|
1396
1396
|
}
|
|
1397
1397
|
break;
|
|
1398
1398
|
}
|
|
1399
|
-
if (opts.nonegate !== true &&
|
|
1399
|
+
if (opts.nonegate !== true && code2 === CHAR_EXCLAMATION_MARK && index === start) {
|
|
1400
1400
|
negated = token.negated = true;
|
|
1401
1401
|
start++;
|
|
1402
1402
|
continue;
|
|
1403
1403
|
}
|
|
1404
|
-
if (opts.noparen !== true &&
|
|
1404
|
+
if (opts.noparen !== true && code2 === CHAR_LEFT_PARENTHESES) {
|
|
1405
1405
|
isGlob = token.isGlob = true;
|
|
1406
1406
|
if (scanToEnd === true) {
|
|
1407
|
-
while (eos() !== true && (
|
|
1408
|
-
if (
|
|
1407
|
+
while (eos() !== true && (code2 = advance())) {
|
|
1408
|
+
if (code2 === CHAR_LEFT_PARENTHESES) {
|
|
1409
1409
|
backslashes = token.backslashes = true;
|
|
1410
|
-
|
|
1410
|
+
code2 = advance();
|
|
1411
1411
|
continue;
|
|
1412
1412
|
}
|
|
1413
|
-
if (
|
|
1413
|
+
if (code2 === CHAR_RIGHT_PARENTHESES) {
|
|
1414
1414
|
finished = true;
|
|
1415
1415
|
break;
|
|
1416
1416
|
}
|
|
@@ -1475,7 +1475,7 @@ var require_scan = __commonJS({
|
|
|
1475
1475
|
};
|
|
1476
1476
|
if (opts.tokens === true) {
|
|
1477
1477
|
state.maxDepth = 0;
|
|
1478
|
-
if (!isPathSeparator(
|
|
1478
|
+
if (!isPathSeparator(code2)) {
|
|
1479
1479
|
tokens.push(token);
|
|
1480
1480
|
}
|
|
1481
1481
|
state.tokens = tokens;
|
|
@@ -2897,14 +2897,14 @@ var require_semver = __commonJS({
|
|
|
2897
2897
|
if (!m[4]) {
|
|
2898
2898
|
this.prerelease = [];
|
|
2899
2899
|
} else {
|
|
2900
|
-
this.prerelease = m[4].split(".").map((
|
|
2901
|
-
if (/^[0-9]+$/.test(
|
|
2902
|
-
const num = +
|
|
2900
|
+
this.prerelease = m[4].split(".").map((id2) => {
|
|
2901
|
+
if (/^[0-9]+$/.test(id2)) {
|
|
2902
|
+
const num = +id2;
|
|
2903
2903
|
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
2904
2904
|
return num;
|
|
2905
2905
|
}
|
|
2906
2906
|
}
|
|
2907
|
-
return
|
|
2907
|
+
return id2;
|
|
2908
2908
|
});
|
|
2909
2909
|
}
|
|
2910
2910
|
this.build = m[5] ? m[5].split(".") : [];
|
|
@@ -3769,7 +3769,7 @@ var require_range = __commonJS({
|
|
|
3769
3769
|
debug2("stars", comp);
|
|
3770
3770
|
return comp;
|
|
3771
3771
|
};
|
|
3772
|
-
var isX = (
|
|
3772
|
+
var isX = (id2) => !id2 || id2.toLowerCase() === "x" || id2 === "*";
|
|
3773
3773
|
var replaceTildes = (comp, options) => {
|
|
3774
3774
|
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
3775
3775
|
};
|
|
@@ -4664,7 +4664,7 @@ var import_node_fs = __toESM(require("node:fs"), 1);
|
|
|
4664
4664
|
var import_vite = require("vite");
|
|
4665
4665
|
var import_vue = require("vue");
|
|
4666
4666
|
|
|
4667
|
-
// node_modules/@rolldown/pluginutils/dist/filter
|
|
4667
|
+
// node_modules/@rolldown/pluginutils/dist/filter-B_mD-HGz.mjs
|
|
4668
4668
|
function exactRegex(str, flags) {
|
|
4669
4669
|
return new RegExp(`^${escapeRegex(str)}$`, flags);
|
|
4670
4670
|
}
|
|
@@ -4673,27 +4673,15 @@ function escapeRegex(str) {
|
|
|
4673
4673
|
return str.replace(escapeRegexRE, "\\$&");
|
|
4674
4674
|
}
|
|
4675
4675
|
function makeIdFiltersToMatchWithQuery(input) {
|
|
4676
|
-
if (!Array.isArray(input))
|
|
4677
|
-
return makeIdFilterToMatchWithQuery(
|
|
4678
|
-
// Array.isArray cannot narrow the type
|
|
4679
|
-
// https://github.com/microsoft/TypeScript/issues/17002
|
|
4680
|
-
input
|
|
4681
|
-
);
|
|
4682
|
-
}
|
|
4676
|
+
if (!Array.isArray(input)) return makeIdFilterToMatchWithQuery(input);
|
|
4683
4677
|
return input.map((i) => makeIdFilterToMatchWithQuery(i));
|
|
4684
4678
|
}
|
|
4685
4679
|
function makeIdFilterToMatchWithQuery(input) {
|
|
4686
|
-
if (typeof input === "string") {
|
|
4687
|
-
return `${input}{?*,}`;
|
|
4688
|
-
}
|
|
4680
|
+
if (typeof input === "string") return `${input}{?*,}`;
|
|
4689
4681
|
return makeRegexIdFilterToMatchWithQuery(input);
|
|
4690
4682
|
}
|
|
4691
4683
|
function makeRegexIdFilterToMatchWithQuery(input) {
|
|
4692
|
-
return new RegExp(
|
|
4693
|
-
// replace `$` with `(?:\?.*)?$` (ignore `\$`)
|
|
4694
|
-
input.source.replace(/(?<!\\)\$/g, "(?:\\?.*)?$"),
|
|
4695
|
-
input.flags
|
|
4696
|
-
);
|
|
4684
|
+
return new RegExp(input.source.replace(/(?<!\\)\$/g, "(?:\\?.*)?$"), input.flags);
|
|
4697
4685
|
}
|
|
4698
4686
|
|
|
4699
4687
|
// node_modules/@vitejs/plugin-vue/dist/index.mjs
|
|
@@ -4701,7 +4689,7 @@ var import_node_path = __toESM(require("node:path"), 1);
|
|
|
4701
4689
|
var import_node_crypto = __toESM(require("node:crypto"), 1);
|
|
4702
4690
|
var import_node_tty = require("node:tty");
|
|
4703
4691
|
var import_node_util = require("node:util");
|
|
4704
|
-
var version = "6.0.
|
|
4692
|
+
var version = "6.0.7";
|
|
4705
4693
|
function resolveCompiler(root) {
|
|
4706
4694
|
const compiler = tryResolveCompiler(root) || tryResolveCompiler();
|
|
4707
4695
|
if (!compiler) throw new Error("Failed to resolve vue/compiler-sfc.\n@vitejs/plugin-vue requires vue (>=3.2.25) to be present in the dependency tree.");
|
|
@@ -4712,23 +4700,23 @@ function tryResolveCompiler(root) {
|
|
|
4712
4700
|
if (vueMeta && vueMeta.version.split(".")[0] >= 3) return tryRequire("vue/compiler-sfc", root);
|
|
4713
4701
|
}
|
|
4714
4702
|
var _require = (0, import_node_module.createRequire)(__filename);
|
|
4715
|
-
function tryRequire(
|
|
4703
|
+
function tryRequire(id2, from) {
|
|
4716
4704
|
try {
|
|
4717
|
-
return from ? _require(_require.resolve(
|
|
4705
|
+
return from ? _require(_require.resolve(id2, { paths: [from] })) : _require(id2);
|
|
4718
4706
|
} catch (e) {
|
|
4719
4707
|
}
|
|
4720
4708
|
}
|
|
4721
|
-
function parseVueRequest(
|
|
4722
|
-
const [filename, rawQuery] =
|
|
4723
|
-
const
|
|
4724
|
-
if (
|
|
4725
|
-
if (
|
|
4726
|
-
if (
|
|
4727
|
-
if (
|
|
4728
|
-
if (
|
|
4709
|
+
function parseVueRequest(id2) {
|
|
4710
|
+
const [filename, rawQuery] = id2.split(`?`, 2);
|
|
4711
|
+
const query2 = Object.fromEntries(new URLSearchParams(rawQuery));
|
|
4712
|
+
if (query2.vue != null) query2.vue = true;
|
|
4713
|
+
if (query2.index != null) query2.index = Number(query2.index);
|
|
4714
|
+
if (query2.raw != null) query2.raw = true;
|
|
4715
|
+
if (query2.url != null) query2.url = true;
|
|
4716
|
+
if (query2.scoped != null) query2.scoped = true;
|
|
4729
4717
|
return {
|
|
4730
4718
|
filename,
|
|
4731
|
-
query
|
|
4719
|
+
query: query2
|
|
4732
4720
|
};
|
|
4733
4721
|
}
|
|
4734
4722
|
var cache = /* @__PURE__ */ new Map();
|
|
@@ -4761,25 +4749,25 @@ function invalidateDescriptor(filename, hmr = false) {
|
|
|
4761
4749
|
_cache.delete(filename);
|
|
4762
4750
|
if (prev) prevCache.set(filename, prev);
|
|
4763
4751
|
}
|
|
4764
|
-
function getDescriptor(filename, options, createIfNotFound = true, hmr = false,
|
|
4752
|
+
function getDescriptor(filename, options, createIfNotFound = true, hmr = false, code2) {
|
|
4765
4753
|
const _cache = hmr ? hmrCache : cache;
|
|
4766
4754
|
if (_cache.has(filename)) return _cache.get(filename);
|
|
4767
4755
|
if (createIfNotFound) {
|
|
4768
|
-
const { descriptor, errors } = createDescriptor(filename,
|
|
4756
|
+
const { descriptor, errors } = createDescriptor(filename, code2 ?? import_node_fs.default.readFileSync(filename, "utf-8"), options, hmr);
|
|
4769
4757
|
if (errors.length && !hmr) throw errors[0];
|
|
4770
4758
|
return descriptor;
|
|
4771
4759
|
}
|
|
4772
4760
|
}
|
|
4773
|
-
function getSrcDescriptor(filename,
|
|
4774
|
-
if (
|
|
4761
|
+
function getSrcDescriptor(filename, query2) {
|
|
4762
|
+
if (query2.scoped) return cache.get(`${filename}?src=${query2.src}`);
|
|
4775
4763
|
return cache.get(filename);
|
|
4776
4764
|
}
|
|
4777
|
-
function getTempSrcDescriptor(filename,
|
|
4765
|
+
function getTempSrcDescriptor(filename, query2) {
|
|
4778
4766
|
return {
|
|
4779
4767
|
filename,
|
|
4780
|
-
id:
|
|
4768
|
+
id: query2.id || "",
|
|
4781
4769
|
styles: [{
|
|
4782
|
-
scoped:
|
|
4770
|
+
scoped: query2.scoped,
|
|
4783
4771
|
loc: { start: {
|
|
4784
4772
|
line: 0,
|
|
4785
4773
|
column: 0
|
|
@@ -4802,24 +4790,24 @@ function slash(path3) {
|
|
|
4802
4790
|
if (path3.startsWith("\\\\?\\")) return path3;
|
|
4803
4791
|
return path3.replace(/\\/g, "/");
|
|
4804
4792
|
}
|
|
4805
|
-
function createRollupError(
|
|
4793
|
+
function createRollupError(id2, error) {
|
|
4806
4794
|
const { message, name, stack } = error;
|
|
4807
4795
|
const rollupError = {
|
|
4808
|
-
id,
|
|
4796
|
+
id: id2,
|
|
4809
4797
|
plugin: "vue",
|
|
4810
4798
|
message,
|
|
4811
4799
|
name,
|
|
4812
4800
|
stack
|
|
4813
4801
|
};
|
|
4814
4802
|
if ("code" in error && error.loc) rollupError.loc = {
|
|
4815
|
-
file:
|
|
4803
|
+
file: id2,
|
|
4816
4804
|
line: error.loc.start.line,
|
|
4817
4805
|
column: error.loc.start.column
|
|
4818
4806
|
};
|
|
4819
4807
|
return rollupError;
|
|
4820
4808
|
}
|
|
4821
|
-
async function transformTemplateAsModule(
|
|
4822
|
-
const result = compile(
|
|
4809
|
+
async function transformTemplateAsModule(code2, filename, descriptor, options, pluginContext, ssr, customElement) {
|
|
4810
|
+
const result = compile(code2, filename, descriptor, options, pluginContext, ssr, customElement);
|
|
4823
4811
|
let returnCode = result.code;
|
|
4824
4812
|
returnCode += `
|
|
4825
4813
|
export const multiRoot = ${JSON.stringify(result.multiRoot)}`;
|
|
@@ -4832,18 +4820,18 @@ import.meta.hot.accept(({ render }) => {
|
|
|
4832
4820
|
map: result.map
|
|
4833
4821
|
};
|
|
4834
4822
|
}
|
|
4835
|
-
function transformTemplateInMain(
|
|
4836
|
-
const result = compile(
|
|
4823
|
+
function transformTemplateInMain(code2, descriptor, options, pluginContext, ssr, customElement) {
|
|
4824
|
+
const result = compile(code2, descriptor.filename, descriptor, options, pluginContext, ssr, customElement);
|
|
4837
4825
|
return {
|
|
4838
4826
|
...result,
|
|
4839
4827
|
code: result.code.replace(/\nexport (function|const) (render|ssrRender)/, "\n$1 _sfc_$2")
|
|
4840
4828
|
};
|
|
4841
4829
|
}
|
|
4842
|
-
function compile(
|
|
4830
|
+
function compile(code2, filename, descriptor, options, pluginContext, ssr, customElement) {
|
|
4843
4831
|
resolveScript(descriptor, options, ssr, customElement);
|
|
4844
4832
|
const result = options.compiler.compileTemplate({
|
|
4845
4833
|
...resolveTemplateCompilerOptions(descriptor, options, filename, ssr),
|
|
4846
|
-
source:
|
|
4834
|
+
source: code2
|
|
4847
4835
|
});
|
|
4848
4836
|
if (result.errors.length) result.errors.forEach((error) => pluginContext.error(typeof error === "string" ? {
|
|
4849
4837
|
id: filename,
|
|
@@ -4860,7 +4848,7 @@ function resolveTemplateCompilerOptions(descriptor, options, filename, ssr) {
|
|
|
4860
4848
|
if (!block) return;
|
|
4861
4849
|
const resolvedScript = getResolvedScript(descriptor, ssr);
|
|
4862
4850
|
const hasScoped = descriptor.styles.some((s) => s.scoped);
|
|
4863
|
-
const { id, cssVars } = descriptor;
|
|
4851
|
+
const { id: id2, cssVars } = descriptor;
|
|
4864
4852
|
let transformAssetUrls = options.template?.transformAssetUrls;
|
|
4865
4853
|
let assetUrlOptions;
|
|
4866
4854
|
if (transformAssetUrls === false) {
|
|
@@ -4893,7 +4881,7 @@ function resolveTemplateCompilerOptions(descriptor, options, filename, ssr) {
|
|
|
4893
4881
|
return {
|
|
4894
4882
|
...options.template,
|
|
4895
4883
|
vapor: descriptor.vapor,
|
|
4896
|
-
id,
|
|
4884
|
+
id: id2,
|
|
4897
4885
|
ast: canReuseAST(options.compiler.version) ? descriptor.template?.ast : void 0,
|
|
4898
4886
|
filename,
|
|
4899
4887
|
scoped: hasScoped,
|
|
@@ -4907,7 +4895,7 @@ function resolveTemplateCompilerOptions(descriptor, options, filename, ssr) {
|
|
|
4907
4895
|
preprocessOptions,
|
|
4908
4896
|
compilerOptions: {
|
|
4909
4897
|
...options.template?.compilerOptions,
|
|
4910
|
-
scopeId: hasScoped ? `data-v-${
|
|
4898
|
+
scopeId: hasScoped ? `data-v-${id2}` : void 0,
|
|
4911
4899
|
bindingMetadata: resolvedScript ? resolvedScript.bindings : void 0,
|
|
4912
4900
|
expressionPlugins,
|
|
4913
4901
|
sourceMap: options.sourceMap
|
|
@@ -5168,14 +5156,14 @@ function parseFileUrl(input) {
|
|
|
5168
5156
|
const path3 = match[2];
|
|
5169
5157
|
return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(path3) ? path3 : "/" + path3, match[3] || "", match[4] || "");
|
|
5170
5158
|
}
|
|
5171
|
-
function makeUrl(scheme, user, host, port, path3,
|
|
5159
|
+
function makeUrl(scheme, user, host, port, path3, query2, hash) {
|
|
5172
5160
|
return {
|
|
5173
5161
|
scheme,
|
|
5174
5162
|
user,
|
|
5175
5163
|
host,
|
|
5176
5164
|
port,
|
|
5177
5165
|
path: path3,
|
|
5178
|
-
query,
|
|
5166
|
+
query: query2,
|
|
5179
5167
|
hash,
|
|
5180
5168
|
type: 7
|
|
5181
5169
|
};
|
|
@@ -5473,8 +5461,6 @@ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLin
|
|
|
5473
5461
|
if (skipable && skipSourceless(line, index)) return;
|
|
5474
5462
|
return insert(line, index, [genColumn]);
|
|
5475
5463
|
}
|
|
5476
|
-
assert(sourceLine);
|
|
5477
|
-
assert(sourceColumn);
|
|
5478
5464
|
const sourcesIndex = put(sources, source);
|
|
5479
5465
|
const namesIndex = name ? put(names2, name) : NO_NAME;
|
|
5480
5466
|
if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null;
|
|
@@ -5492,8 +5478,6 @@ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLin
|
|
|
5492
5478
|
sourceColumn
|
|
5493
5479
|
]);
|
|
5494
5480
|
}
|
|
5495
|
-
function assert(_val) {
|
|
5496
|
-
}
|
|
5497
5481
|
function getIndex(arr, index) {
|
|
5498
5482
|
for (let i = arr.length; i <= index; i++) arr[i] = [];
|
|
5499
5483
|
return arr[index];
|
|
@@ -5529,7 +5513,6 @@ function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIn
|
|
|
5529
5513
|
function addMappingInternal(skipable, map, mapping2) {
|
|
5530
5514
|
const { generated, source, original, name, content } = mapping2;
|
|
5531
5515
|
if (!source) return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null, null);
|
|
5532
|
-
assert(original);
|
|
5533
5516
|
return addSegmentInternal(skipable, map, generated.line - 1, generated.column, source, original.line - 1, original.column, name, content);
|
|
5534
5517
|
}
|
|
5535
5518
|
function coerce(value) {
|
|
@@ -5936,11 +5919,11 @@ export default (sfc, props) => {
|
|
|
5936
5919
|
return target;
|
|
5937
5920
|
}
|
|
5938
5921
|
`;
|
|
5939
|
-
async function transformMain(
|
|
5922
|
+
async function transformMain(code2, filename, options, pluginContext, ssr, customElement) {
|
|
5940
5923
|
const { devServer, isProduction, devToolsEnabled } = options;
|
|
5941
5924
|
const prevDescriptor = getPrevDescriptor(filename);
|
|
5942
|
-
const { descriptor, errors } = createDescriptor(filename,
|
|
5943
|
-
if (import_node_fs.default.existsSync(filename)) getDescriptor(filename, options, true, true, filename.endsWith(".vue") ? void 0 :
|
|
5925
|
+
const { descriptor, errors } = createDescriptor(filename, code2, options);
|
|
5926
|
+
if (import_node_fs.default.existsSync(filename)) getDescriptor(filename, options, true, true, filename.endsWith(".vue") ? void 0 : code2);
|
|
5944
5927
|
if (errors.length) {
|
|
5945
5928
|
errors.forEach((error) => pluginContext.error(createRollupError(filename, error)));
|
|
5946
5929
|
return null;
|
|
@@ -6016,22 +5999,22 @@ async function transformMain(code, filename, options, pluginContext, ssr, custom
|
|
|
6016
5999
|
if (lang && /tsx?$/.test(lang) && !descriptor.script?.src) {
|
|
6017
6000
|
const { transformWithOxc } = await import("vite");
|
|
6018
6001
|
if (transformWithOxc) {
|
|
6019
|
-
const { code:
|
|
6002
|
+
const { code: code3, map } = await transformWithOxc(resolvedCode, filename, {
|
|
6020
6003
|
...options.devServer?.config.oxc,
|
|
6021
6004
|
lang: "ts",
|
|
6022
6005
|
sourcemap: options.sourceMap
|
|
6023
6006
|
}, resolvedMap);
|
|
6024
|
-
resolvedCode =
|
|
6007
|
+
resolvedCode = code3;
|
|
6025
6008
|
resolvedMap = resolvedMap ? map : resolvedMap;
|
|
6026
6009
|
} else {
|
|
6027
|
-
const { code:
|
|
6010
|
+
const { code: code3, map } = await (0, import_vite.transformWithEsbuild)(resolvedCode, filename, {
|
|
6028
6011
|
target: "esnext",
|
|
6029
6012
|
charset: "utf8",
|
|
6030
6013
|
...options.devServer?.config.esbuild,
|
|
6031
6014
|
loader: "ts",
|
|
6032
6015
|
sourcemap: options.sourceMap
|
|
6033
6016
|
}, resolvedMap);
|
|
6034
|
-
resolvedCode =
|
|
6017
|
+
resolvedCode = code3;
|
|
6035
6018
|
resolvedMap = resolvedMap ? map : resolvedMap;
|
|
6036
6019
|
}
|
|
6037
6020
|
}
|
|
@@ -6054,8 +6037,8 @@ async function genTemplateCode(descriptor, options, pluginContext, ssr, customEl
|
|
|
6054
6037
|
} else {
|
|
6055
6038
|
if (template.src) await linkSrcToDescriptor(template.src, descriptor, pluginContext, hasScoped);
|
|
6056
6039
|
const src = template.src || descriptor.filename;
|
|
6057
|
-
const
|
|
6058
|
-
const request = JSON.stringify(src +
|
|
6040
|
+
const query2 = `?vue&type=template${template.src ? hasScoped ? `&src=${descriptor.id}` : "&src=true" : ""}${hasScoped ? `&scoped=${descriptor.id}` : ``}${attrsToQuery(template.attrs, "js", true)}`;
|
|
6041
|
+
const request = JSON.stringify(src + query2);
|
|
6059
6042
|
const renderFnName = ssr ? "ssrRender" : "render";
|
|
6060
6043
|
return {
|
|
6061
6044
|
code: `import { ${renderFnName} as _sfc_${renderFnName}${needsMultiRoot ? ", multiRoot as _sfc_multiRoot" : ""} } from ${request}`,
|
|
@@ -6079,8 +6062,8 @@ async function genScriptCode(descriptor, options, pluginContext, ssr, customElem
|
|
|
6079
6062
|
const src = script.src || descriptor.filename;
|
|
6080
6063
|
const langFallback = script.src && import_node_path.default.extname(src).slice(1) || "js";
|
|
6081
6064
|
const attrsQuery = attrsToQuery(script.attrs, langFallback);
|
|
6082
|
-
const
|
|
6083
|
-
const request = JSON.stringify(src +
|
|
6065
|
+
const query2 = `?vue&type=script${script.src ? `&src=true` : ``}${attrsQuery}`;
|
|
6066
|
+
const request = JSON.stringify(src + query2);
|
|
6084
6067
|
scriptCode = `import _sfc_main from ${request}
|
|
6085
6068
|
export * from ${request}`;
|
|
6086
6069
|
}
|
|
@@ -6115,7 +6098,7 @@ import ${JSON.stringify(styleRequest)}`;
|
|
|
6115
6098
|
if (customElement) attachedProps.push([`styles`, `[${descriptor.styles.map((_2, i) => `_style_${i}`).join(",")}]`]);
|
|
6116
6099
|
}
|
|
6117
6100
|
if (cssModulesMap) {
|
|
6118
|
-
const mappingCode = Object.entries(cssModulesMap).reduce((
|
|
6101
|
+
const mappingCode = Object.entries(cssModulesMap).reduce((code2, [key, value]) => code2 + `"${key}":${value},
|
|
6119
6102
|
`, "{\n") + "}";
|
|
6120
6103
|
stylesCode += `
|
|
6121
6104
|
const cssModules = ${mappingCode}`;
|
|
@@ -6131,21 +6114,21 @@ function genCSSModulesCode(index, request, moduleName) {
|
|
|
6131
6114
|
import ${styleVar} from ${JSON.stringify(moduleRequest)}`, { [exposedName]: styleVar }];
|
|
6132
6115
|
}
|
|
6133
6116
|
async function genCustomBlockCode(descriptor, pluginContext) {
|
|
6134
|
-
let
|
|
6117
|
+
let code2 = "";
|
|
6135
6118
|
for (let index = 0; index < descriptor.customBlocks.length; index++) {
|
|
6136
6119
|
const block = descriptor.customBlocks[index];
|
|
6137
6120
|
if (block.src) await linkSrcToDescriptor(block.src, descriptor, pluginContext, false);
|
|
6138
6121
|
const src = block.src || descriptor.filename;
|
|
6139
6122
|
const attrsQuery = attrsToQuery(block.attrs, block.type);
|
|
6140
6123
|
const srcQuery = block.src ? `&src=true` : ``;
|
|
6141
|
-
const
|
|
6142
|
-
const request = JSON.stringify(src +
|
|
6143
|
-
|
|
6124
|
+
const query2 = `?vue&type=${block.type}&index=${index}${srcQuery}${attrsQuery}`;
|
|
6125
|
+
const request = JSON.stringify(src + query2);
|
|
6126
|
+
code2 += `import block${index} from ${request}
|
|
6144
6127
|
`;
|
|
6145
|
-
|
|
6128
|
+
code2 += `if (typeof block${index} === 'function') block${index}(_sfc_main)
|
|
6146
6129
|
`;
|
|
6147
6130
|
}
|
|
6148
|
-
return
|
|
6131
|
+
return code2;
|
|
6149
6132
|
}
|
|
6150
6133
|
async function linkSrcToDescriptor(src, descriptor, pluginContext, scoped) {
|
|
6151
6134
|
setSrcDescriptor(((await pluginContext.resolve(src, descriptor.filename))?.id || src).replace(/\?.*$/, ""), descriptor, scoped);
|
|
@@ -6161,22 +6144,22 @@ var ignoreList = [
|
|
|
6161
6144
|
"generic"
|
|
6162
6145
|
];
|
|
6163
6146
|
function attrsToQuery(attrs, langFallback, forceLangFallback = false) {
|
|
6164
|
-
let
|
|
6147
|
+
let query2 = ``;
|
|
6165
6148
|
for (const name in attrs) {
|
|
6166
6149
|
const value = attrs[name];
|
|
6167
|
-
if (!ignoreList.includes(name))
|
|
6150
|
+
if (!ignoreList.includes(name)) query2 += `&${encodeURIComponent(name)}${value ? `=${encodeURIComponent(value)}` : ``}`;
|
|
6168
6151
|
}
|
|
6169
|
-
if (langFallback || attrs.lang)
|
|
6170
|
-
return
|
|
6152
|
+
if (langFallback || attrs.lang) query2 += `lang` in attrs ? forceLangFallback ? `&lang.${langFallback}` : `&lang.${attrs.lang}` : `&lang.${langFallback}`;
|
|
6153
|
+
return query2;
|
|
6171
6154
|
}
|
|
6172
|
-
async function transformStyle(
|
|
6155
|
+
async function transformStyle(code2, descriptor, index, options, pluginContext, filename) {
|
|
6173
6156
|
const block = descriptor.styles[index];
|
|
6174
6157
|
const result = await options.compiler.compileStyleAsync({
|
|
6175
6158
|
...options.style,
|
|
6176
6159
|
filename: descriptor.filename,
|
|
6177
6160
|
id: `data-v-${descriptor.id}`,
|
|
6178
6161
|
isProd: options.isProduction,
|
|
6179
|
-
source:
|
|
6162
|
+
source: code2,
|
|
6180
6163
|
scoped: block.scoped,
|
|
6181
6164
|
...options.cssDevSourcemap ? { postcssOptions: { map: {
|
|
6182
6165
|
from: filename,
|
|
@@ -6213,10 +6196,10 @@ function vuePlugin(rawOptions = {}) {
|
|
|
6213
6196
|
sourceMap: true,
|
|
6214
6197
|
cssDevSourcemap: false
|
|
6215
6198
|
});
|
|
6216
|
-
const
|
|
6217
|
-
const
|
|
6199
|
+
const include2 = (0, import_vue.shallowRef)(rawOptions.include ?? /\.vue$/);
|
|
6200
|
+
const exclude2 = (0, import_vue.shallowRef)(rawOptions.exclude);
|
|
6218
6201
|
let optionsHookIsCalled = false;
|
|
6219
|
-
const filter2 = (0, import_vue.computed)(() => (0, import_vite.createFilter)(
|
|
6202
|
+
const filter2 = (0, import_vue.computed)(() => (0, import_vite.createFilter)(include2.value, exclude2.value));
|
|
6220
6203
|
const customElementFilter = (0, import_vue.computed)(() => {
|
|
6221
6204
|
const customElement = options.value.features?.customElement || options.value.customElement;
|
|
6222
6205
|
return typeof customElement === "boolean" ? () => customElement : (0, import_vite.createFilter)(customElement);
|
|
@@ -6232,18 +6215,18 @@ function vuePlugin(rawOptions = {}) {
|
|
|
6232
6215
|
options.value = value;
|
|
6233
6216
|
},
|
|
6234
6217
|
get include() {
|
|
6235
|
-
return
|
|
6218
|
+
return include2.value;
|
|
6236
6219
|
},
|
|
6237
6220
|
set include(value) {
|
|
6238
6221
|
if (optionsHookIsCalled) throw new Error("include cannot be updated after `options` hook is called");
|
|
6239
|
-
|
|
6222
|
+
include2.value = value;
|
|
6240
6223
|
},
|
|
6241
6224
|
get exclude() {
|
|
6242
|
-
return
|
|
6225
|
+
return exclude2.value;
|
|
6243
6226
|
},
|
|
6244
6227
|
set exclude(value) {
|
|
6245
6228
|
if (optionsHookIsCalled) throw new Error("exclude cannot be updated after `options` hook is called");
|
|
6246
|
-
|
|
6229
|
+
exclude2.value = value;
|
|
6247
6230
|
},
|
|
6248
6231
|
version
|
|
6249
6232
|
},
|
|
@@ -6299,12 +6282,12 @@ function vuePlugin(rawOptions = {}) {
|
|
|
6299
6282
|
options() {
|
|
6300
6283
|
optionsHookIsCalled = true;
|
|
6301
6284
|
plugin.transform.filter = { id: {
|
|
6302
|
-
include: [...makeIdFiltersToMatchWithQuery(ensureArray(
|
|
6303
|
-
exclude:
|
|
6285
|
+
include: [...makeIdFiltersToMatchWithQuery(ensureArray(include2.value)), /[?&]vue\b/],
|
|
6286
|
+
exclude: exclude2.value
|
|
6304
6287
|
} };
|
|
6305
6288
|
},
|
|
6306
|
-
shouldTransformCachedModule({ id }) {
|
|
6307
|
-
if (transformCachedModule && parseVueRequest(
|
|
6289
|
+
shouldTransformCachedModule({ id: id2 }) {
|
|
6290
|
+
if (transformCachedModule && parseVueRequest(id2).query.vue) return true;
|
|
6308
6291
|
return false;
|
|
6309
6292
|
},
|
|
6310
6293
|
configureServer(server) {
|
|
@@ -6318,25 +6301,25 @@ function vuePlugin(rawOptions = {}) {
|
|
|
6318
6301
|
},
|
|
6319
6302
|
resolveId: {
|
|
6320
6303
|
filter: { id: [exactRegex(EXPORT_HELPER_ID), /[?&]vue\b/] },
|
|
6321
|
-
handler(
|
|
6322
|
-
if (
|
|
6323
|
-
if (parseVueRequest(
|
|
6304
|
+
handler(id2) {
|
|
6305
|
+
if (id2 === "\0plugin-vue:export-helper") return id2;
|
|
6306
|
+
if (parseVueRequest(id2).query.vue) return id2;
|
|
6324
6307
|
}
|
|
6325
6308
|
},
|
|
6326
6309
|
load: {
|
|
6327
6310
|
filter: { id: [exactRegex(EXPORT_HELPER_ID), /[?&]vue\b/] },
|
|
6328
|
-
handler(
|
|
6329
|
-
if (
|
|
6311
|
+
handler(id2, opt) {
|
|
6312
|
+
if (id2 === "\0plugin-vue:export-helper") return helperCode;
|
|
6330
6313
|
const ssr = opt?.ssr === true;
|
|
6331
|
-
const { filename, query } = parseVueRequest(
|
|
6332
|
-
if (
|
|
6333
|
-
if (
|
|
6314
|
+
const { filename, query: query2 } = parseVueRequest(id2);
|
|
6315
|
+
if (query2.vue) {
|
|
6316
|
+
if (query2.src) return import_node_fs.default.readFileSync(filename, "utf-8");
|
|
6334
6317
|
const descriptor = getDescriptor(filename, options.value);
|
|
6335
6318
|
let block;
|
|
6336
|
-
if (
|
|
6337
|
-
else if (
|
|
6338
|
-
else if (
|
|
6339
|
-
else if (
|
|
6319
|
+
if (query2.type === "script") block = resolveScript(descriptor, options.value, ssr, customElementFilter.value(filename));
|
|
6320
|
+
else if (query2.type === "template") block = descriptor.template;
|
|
6321
|
+
else if (query2.type === "style") block = descriptor.styles[query2.index];
|
|
6322
|
+
else if (query2.index != null) block = descriptor.customBlocks[query2.index];
|
|
6340
6323
|
if (block) return {
|
|
6341
6324
|
code: block.content,
|
|
6342
6325
|
map: block.map
|
|
@@ -6344,17 +6327,17 @@ function vuePlugin(rawOptions = {}) {
|
|
|
6344
6327
|
}
|
|
6345
6328
|
}
|
|
6346
6329
|
},
|
|
6347
|
-
transform: { handler(
|
|
6330
|
+
transform: { handler(code2, id2, opt) {
|
|
6348
6331
|
const ssr = opt?.ssr === true;
|
|
6349
|
-
const { filename, query } = parseVueRequest(
|
|
6350
|
-
if (
|
|
6351
|
-
if (!filter2.value(filename) && !
|
|
6352
|
-
if (!
|
|
6332
|
+
const { filename, query: query2 } = parseVueRequest(id2);
|
|
6333
|
+
if (query2.raw || query2.url) return;
|
|
6334
|
+
if (!filter2.value(filename) && !query2.vue) return;
|
|
6335
|
+
if (!query2.vue) return transformMain(code2, filename, options.value, this, ssr, customElementFilter.value(filename));
|
|
6353
6336
|
else {
|
|
6354
|
-
const descriptor =
|
|
6355
|
-
if (
|
|
6356
|
-
if (
|
|
6357
|
-
else if (
|
|
6337
|
+
const descriptor = query2.src ? getSrcDescriptor(filename, query2) || getTempSrcDescriptor(filename, query2) : getDescriptor(filename, options.value);
|
|
6338
|
+
if (query2.src) this.addWatchFile(filename);
|
|
6339
|
+
if (query2.type === "template") return transformTemplateAsModule(code2, filename, descriptor, options.value, this, ssr, customElementFilter.value(filename));
|
|
6340
|
+
else if (query2.type === "style") return transformStyle(code2, descriptor, Number(query2.index || 0), options.value, this, filename);
|
|
6358
6341
|
}
|
|
6359
6342
|
} }
|
|
6360
6343
|
};
|
|
@@ -9775,8 +9758,8 @@ var SourceMap = class {
|
|
|
9775
9758
|
return "data:application/json;charset=utf-8;base64," + btoa(this.toString());
|
|
9776
9759
|
}
|
|
9777
9760
|
};
|
|
9778
|
-
function guessIndent(
|
|
9779
|
-
const lines =
|
|
9761
|
+
function guessIndent(code2) {
|
|
9762
|
+
const lines = code2.split("\n");
|
|
9780
9763
|
const tabbed = lines.filter((line) => /^\t+/.test(line));
|
|
9781
9764
|
const spaced = lines.filter((line) => /^ {2,}/.test(line));
|
|
9782
9765
|
if (tabbed.length === 0 && spaced.length === 0) {
|
|
@@ -10747,26 +10730,26 @@ function toArray(thing) {
|
|
|
10747
10730
|
return [thing];
|
|
10748
10731
|
}
|
|
10749
10732
|
var escapeMark = "[_#EsCaPe#_]";
|
|
10750
|
-
function getMatcherString(
|
|
10751
|
-
if (resolutionBase === false || isAbsolute(
|
|
10733
|
+
function getMatcherString(id2, resolutionBase) {
|
|
10734
|
+
if (resolutionBase === false || isAbsolute(id2) || id2.startsWith("**")) return normalizePath2(id2);
|
|
10752
10735
|
const basePath = normalizePath2(resolve2(resolutionBase || "")).replaceAll(/[-^$*+?.()|[\]{}]/g, `${escapeMark}$&`);
|
|
10753
|
-
return join(basePath, normalizePath2(
|
|
10736
|
+
return join(basePath, normalizePath2(id2)).replaceAll(escapeMark, "\\");
|
|
10754
10737
|
}
|
|
10755
|
-
function createFilter2(
|
|
10738
|
+
function createFilter2(include2, exclude2, options) {
|
|
10756
10739
|
const resolutionBase = options && options.resolve;
|
|
10757
|
-
const getMatcher = (
|
|
10758
|
-
const pattern = getMatcherString(
|
|
10740
|
+
const getMatcher = (id2) => id2 instanceof RegExp ? id2 : { test: (what) => {
|
|
10741
|
+
const pattern = getMatcherString(id2, resolutionBase);
|
|
10759
10742
|
const fn = (0, import_picomatch.default)(pattern, { dot: true });
|
|
10760
10743
|
const result = fn(what);
|
|
10761
10744
|
return result;
|
|
10762
10745
|
} };
|
|
10763
|
-
const includeMatchers = toArray(
|
|
10764
|
-
const excludeMatchers = toArray(
|
|
10765
|
-
if (!includeMatchers.length && !excludeMatchers.length) return (
|
|
10766
|
-
return function result(
|
|
10767
|
-
if (typeof
|
|
10768
|
-
if (
|
|
10769
|
-
const pathId = normalizePath2(
|
|
10746
|
+
const includeMatchers = toArray(include2).map(getMatcher);
|
|
10747
|
+
const excludeMatchers = toArray(exclude2).map(getMatcher);
|
|
10748
|
+
if (!includeMatchers.length && !excludeMatchers.length) return (id2) => typeof id2 === "string" && !id2.includes("\0");
|
|
10749
|
+
return function result(id2) {
|
|
10750
|
+
if (typeof id2 !== "string") return false;
|
|
10751
|
+
if (id2.includes("\0")) return false;
|
|
10752
|
+
const pathId = normalizePath2(id2);
|
|
10770
10753
|
for (const matcher of excludeMatchers) {
|
|
10771
10754
|
if (matcher instanceof RegExp) matcher.lastIndex = 0;
|
|
10772
10755
|
if (matcher.test(pathId)) return false;
|
|
@@ -10787,20 +10770,20 @@ function PluginPure(options) {
|
|
|
10787
10770
|
name: "rollup-plugin-pure",
|
|
10788
10771
|
transform: {
|
|
10789
10772
|
order: "post",
|
|
10790
|
-
handler(
|
|
10791
|
-
if (!filter2(
|
|
10773
|
+
handler(code2, id2) {
|
|
10774
|
+
if (!filter2(id2)) {
|
|
10792
10775
|
return;
|
|
10793
10776
|
}
|
|
10794
|
-
if (options.functions.every((func) => typeof func === "string" && !
|
|
10777
|
+
if (options.functions.every((func) => typeof func === "string" && !code2.includes(func))) {
|
|
10795
10778
|
return;
|
|
10796
10779
|
}
|
|
10797
10780
|
let ast;
|
|
10798
10781
|
try {
|
|
10799
|
-
ast = this.parse(
|
|
10782
|
+
ast = this.parse(code2);
|
|
10800
10783
|
} catch {
|
|
10801
10784
|
return null;
|
|
10802
10785
|
}
|
|
10803
|
-
const s = new MagicString(
|
|
10786
|
+
const s = new MagicString(code2);
|
|
10804
10787
|
let offset = 0;
|
|
10805
10788
|
walk(ast, {
|
|
10806
10789
|
enter(_node) {
|
|
@@ -10854,11 +10837,11 @@ function babelPlugin() {
|
|
|
10854
10837
|
name: "fk:babel",
|
|
10855
10838
|
enforce: "post",
|
|
10856
10839
|
apply: "build",
|
|
10857
|
-
async transform(src,
|
|
10858
|
-
if (
|
|
10840
|
+
async transform(src, id2) {
|
|
10841
|
+
if (id2 === "\0rolldown/runtime.js") {
|
|
10859
10842
|
return null;
|
|
10860
10843
|
}
|
|
10861
|
-
const { pathname: filename } = new URL(
|
|
10844
|
+
const { pathname: filename } = new URL(id2, "file://");
|
|
10862
10845
|
if (!filter.test(filename)) {
|
|
10863
10846
|
return null;
|
|
10864
10847
|
}
|
|
@@ -10870,9 +10853,9 @@ function babelPlugin() {
|
|
|
10870
10853
|
if (!transformed) {
|
|
10871
10854
|
return null;
|
|
10872
10855
|
}
|
|
10873
|
-
const { code, map } = transformed;
|
|
10856
|
+
const { code: code2, map } = transformed;
|
|
10874
10857
|
return {
|
|
10875
|
-
code:
|
|
10858
|
+
code: code2 ?? src,
|
|
10876
10859
|
map: map ?? null
|
|
10877
10860
|
};
|
|
10878
10861
|
}
|
|
@@ -10962,8 +10945,8 @@ function indexHtmlPlugin() {
|
|
|
10962
10945
|
},
|
|
10963
10946
|
load: {
|
|
10964
10947
|
order: "pre",
|
|
10965
|
-
handler(
|
|
10966
|
-
if (
|
|
10948
|
+
handler(id2) {
|
|
10949
|
+
if (id2 === VIRTUAL_ENTRYPOINT) {
|
|
10967
10950
|
return "";
|
|
10968
10951
|
}
|
|
10969
10952
|
}
|