@forsakringskassan/vite-lib-config 3.6.0 → 3.6.1
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/tsdoc-metadata.json +1 -1
- package/dist/vite.config.cjs +118 -79
- package/dist/vite.config.mjs +117 -78
- package/package.json +2 -2
package/dist/tsdoc-metadata.json
CHANGED
package/dist/vite.config.cjs
CHANGED
|
@@ -1064,7 +1064,7 @@ var require_dist = __commonJS({
|
|
|
1064
1064
|
var crypto__default = /* @__PURE__ */ _interopDefaultCompat(crypto);
|
|
1065
1065
|
var require$$0__default = /* @__PURE__ */ _interopDefaultCompat(require$$0);
|
|
1066
1066
|
var require$$1__default = /* @__PURE__ */ _interopDefaultCompat(require$$1);
|
|
1067
|
-
var version2 = "5.2.
|
|
1067
|
+
var version2 = "5.2.3";
|
|
1068
1068
|
function resolveCompiler(root) {
|
|
1069
1069
|
const compiler = tryResolveCompiler(root) || tryResolveCompiler();
|
|
1070
1070
|
if (!compiler) {
|
|
@@ -1081,7 +1081,7 @@ var require_dist = __commonJS({
|
|
|
1081
1081
|
return tryRequire("vue/compiler-sfc", root);
|
|
1082
1082
|
}
|
|
1083
1083
|
}
|
|
1084
|
-
var _require = node_module.createRequire(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index.cjs", document.baseURI).href);
|
|
1084
|
+
var _require = node_module.createRequire(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("index.cjs", document.baseURI).href);
|
|
1085
1085
|
function tryRequire(id, from) {
|
|
1086
1086
|
try {
|
|
1087
1087
|
return from ? _require(_require.resolve(id, { paths: [from] })) : _require(id);
|
|
@@ -1192,7 +1192,8 @@ var require_dist = __commonJS({
|
|
|
1192
1192
|
start: { line: 0, column: 0 }
|
|
1193
1193
|
}
|
|
1194
1194
|
}
|
|
1195
|
-
]
|
|
1195
|
+
],
|
|
1196
|
+
isTemp: true
|
|
1196
1197
|
};
|
|
1197
1198
|
}
|
|
1198
1199
|
function setSrcDescriptor(filename, entry, scoped) {
|
|
@@ -1346,6 +1347,8 @@ import.meta.hot.accept(({ render }) => {
|
|
|
1346
1347
|
}
|
|
1347
1348
|
return {
|
|
1348
1349
|
...options.template,
|
|
1350
|
+
// @ts-expect-error TODO remove when 3.6 is out
|
|
1351
|
+
vapor: descriptor.vapor,
|
|
1349
1352
|
id,
|
|
1350
1353
|
ast: canReuseAST(options.compiler.version) ? descriptor.template?.ast : void 0,
|
|
1351
1354
|
filename,
|
|
@@ -1408,8 +1411,7 @@ import.meta.hot.accept(({ render }) => {
|
|
|
1408
1411
|
if (cached) {
|
|
1409
1412
|
return cached;
|
|
1410
1413
|
}
|
|
1411
|
-
|
|
1412
|
-
resolved = options.compiler.compileScript(descriptor, {
|
|
1414
|
+
const resolved = options.compiler.compileScript(descriptor, {
|
|
1413
1415
|
...options.script,
|
|
1414
1416
|
id: descriptor.id,
|
|
1415
1417
|
isProd: options.isProduction,
|
|
@@ -1934,10 +1936,6 @@ import.meta.hot.accept(({ render }) => {
|
|
|
1934
1936
|
return indexes[key] = length - 1;
|
|
1935
1937
|
}
|
|
1936
1938
|
var COLUMN = 0;
|
|
1937
|
-
var SOURCES_INDEX = 1;
|
|
1938
|
-
var SOURCE_LINE = 2;
|
|
1939
|
-
var SOURCE_COLUMN = 3;
|
|
1940
|
-
var NAMES_INDEX = 4;
|
|
1941
1939
|
var NO_NAME = -1;
|
|
1942
1940
|
var GenMapping = class {
|
|
1943
1941
|
constructor({ file, sourceRoot } = {}) {
|
|
@@ -1990,17 +1988,12 @@ import.meta.hot.accept(({ render }) => {
|
|
|
1990
1988
|
const line = getLine(mappings, genLine);
|
|
1991
1989
|
const index = getColumnIndex(line, genColumn);
|
|
1992
1990
|
if (!source) {
|
|
1993
|
-
if (skipable && skipSourceless(line, index))
|
|
1994
|
-
return;
|
|
1995
1991
|
return insert(line, index, [genColumn]);
|
|
1996
1992
|
}
|
|
1997
1993
|
const sourcesIndex = put(sources, source);
|
|
1998
1994
|
const namesIndex = name ? put(names, name) : NO_NAME;
|
|
1999
1995
|
if (sourcesIndex === sourcesContent.length)
|
|
2000
1996
|
sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null;
|
|
2001
|
-
if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
|
|
2002
|
-
return;
|
|
2003
|
-
}
|
|
2004
1997
|
return insert(line, index, name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn]);
|
|
2005
1998
|
}
|
|
2006
1999
|
function getLine(mappings, index) {
|
|
@@ -2038,20 +2031,6 @@ import.meta.hot.accept(({ render }) => {
|
|
|
2038
2031
|
for (let i = 0; i < array.length; i++)
|
|
2039
2032
|
put(setarr, array[i]);
|
|
2040
2033
|
}
|
|
2041
|
-
function skipSourceless(line, index) {
|
|
2042
|
-
if (index === 0)
|
|
2043
|
-
return true;
|
|
2044
|
-
const prev = line[index - 1];
|
|
2045
|
-
return prev.length === 1;
|
|
2046
|
-
}
|
|
2047
|
-
function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
|
|
2048
|
-
if (index === 0)
|
|
2049
|
-
return false;
|
|
2050
|
-
const prev = line[index - 1];
|
|
2051
|
-
if (prev.length === 1)
|
|
2052
|
-
return false;
|
|
2053
|
-
return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME);
|
|
2054
|
-
}
|
|
2055
2034
|
function addMappingInternal(skipable, map, mapping2) {
|
|
2056
2035
|
const { generated, source, original, name, content } = mapping2;
|
|
2057
2036
|
if (!source) {
|
|
@@ -2286,50 +2265,64 @@ import.meta.hot.accept(({ render }) => {
|
|
|
2286
2265
|
createDebug.namespaces = namespaces;
|
|
2287
2266
|
createDebug.names = [];
|
|
2288
2267
|
createDebug.skips = [];
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2268
|
+
const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
|
|
2269
|
+
for (const ns of split) {
|
|
2270
|
+
if (ns[0] === "-") {
|
|
2271
|
+
createDebug.skips.push(ns.slice(1));
|
|
2272
|
+
} else {
|
|
2273
|
+
createDebug.names.push(ns);
|
|
2295
2274
|
}
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
function matchesTemplate(search, template) {
|
|
2278
|
+
let searchIndex = 0;
|
|
2279
|
+
let templateIndex = 0;
|
|
2280
|
+
let starIndex = -1;
|
|
2281
|
+
let matchIndex = 0;
|
|
2282
|
+
while (searchIndex < search.length) {
|
|
2283
|
+
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
|
|
2284
|
+
if (template[templateIndex] === "*") {
|
|
2285
|
+
starIndex = templateIndex;
|
|
2286
|
+
matchIndex = searchIndex;
|
|
2287
|
+
templateIndex++;
|
|
2288
|
+
} else {
|
|
2289
|
+
searchIndex++;
|
|
2290
|
+
templateIndex++;
|
|
2291
|
+
}
|
|
2292
|
+
} else if (starIndex !== -1) {
|
|
2293
|
+
templateIndex = starIndex + 1;
|
|
2294
|
+
matchIndex++;
|
|
2295
|
+
searchIndex = matchIndex;
|
|
2299
2296
|
} else {
|
|
2300
|
-
|
|
2297
|
+
return false;
|
|
2301
2298
|
}
|
|
2302
2299
|
}
|
|
2300
|
+
while (templateIndex < template.length && template[templateIndex] === "*") {
|
|
2301
|
+
templateIndex++;
|
|
2302
|
+
}
|
|
2303
|
+
return templateIndex === template.length;
|
|
2303
2304
|
}
|
|
2304
2305
|
function disable() {
|
|
2305
2306
|
const namespaces = [
|
|
2306
|
-
...createDebug.names
|
|
2307
|
-
...createDebug.skips.map(
|
|
2307
|
+
...createDebug.names,
|
|
2308
|
+
...createDebug.skips.map((namespace) => "-" + namespace)
|
|
2308
2309
|
].join(",");
|
|
2309
2310
|
createDebug.enable("");
|
|
2310
2311
|
return namespaces;
|
|
2311
2312
|
}
|
|
2312
2313
|
function enabled(name) {
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
}
|
|
2316
|
-
let i;
|
|
2317
|
-
let len;
|
|
2318
|
-
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
|
2319
|
-
if (createDebug.skips[i].test(name)) {
|
|
2314
|
+
for (const skip of createDebug.skips) {
|
|
2315
|
+
if (matchesTemplate(name, skip)) {
|
|
2320
2316
|
return false;
|
|
2321
2317
|
}
|
|
2322
2318
|
}
|
|
2323
|
-
for (
|
|
2324
|
-
if (
|
|
2319
|
+
for (const ns of createDebug.names) {
|
|
2320
|
+
if (matchesTemplate(name, ns)) {
|
|
2325
2321
|
return true;
|
|
2326
2322
|
}
|
|
2327
2323
|
}
|
|
2328
2324
|
return false;
|
|
2329
2325
|
}
|
|
2330
|
-
function toNamespace(regexp) {
|
|
2331
|
-
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
|
|
2332
|
-
}
|
|
2333
2326
|
function coerce(val) {
|
|
2334
2327
|
if (val instanceof Error) {
|
|
2335
2328
|
return val.stack || val.message;
|
|
@@ -2694,16 +2687,22 @@ import.meta.hot.accept(({ render }) => {
|
|
|
2694
2687
|
})(node, node.exports);
|
|
2695
2688
|
return node.exports;
|
|
2696
2689
|
}
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2690
|
+
var hasRequiredSrc;
|
|
2691
|
+
function requireSrc() {
|
|
2692
|
+
if (hasRequiredSrc) return src.exports;
|
|
2693
|
+
hasRequiredSrc = 1;
|
|
2694
|
+
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
2695
|
+
src.exports = requireBrowser();
|
|
2696
|
+
} else {
|
|
2697
|
+
src.exports = requireNode();
|
|
2698
|
+
}
|
|
2699
|
+
return src.exports;
|
|
2701
2700
|
}
|
|
2702
|
-
var srcExports =
|
|
2701
|
+
var srcExports = requireSrc();
|
|
2703
2702
|
var _debug = /* @__PURE__ */ getDefaultExportFromCjs(srcExports);
|
|
2704
2703
|
var debug = _debug("vite:hmr");
|
|
2705
2704
|
var directRequestRE = /(?:\?|&)direct\b/;
|
|
2706
|
-
async function handleHotUpdate({ file, modules, read }, options, customElement) {
|
|
2705
|
+
async function handleHotUpdate({ file, modules, read }, options, customElement, typeDepModules) {
|
|
2707
2706
|
const prevDescriptor = getDescriptor(file, options, false, true);
|
|
2708
2707
|
if (!prevDescriptor) {
|
|
2709
2708
|
return;
|
|
@@ -2804,17 +2803,15 @@ import.meta.hot.accept(({ render }) => {
|
|
|
2804
2803
|
}
|
|
2805
2804
|
debug(`[vue:update(${updateType.join("&")})] ${file}`);
|
|
2806
2805
|
}
|
|
2807
|
-
return [...affectedModules].filter(
|
|
2806
|
+
return [...affectedModules, ...typeDepModules || []].filter(
|
|
2807
|
+
Boolean
|
|
2808
|
+
);
|
|
2808
2809
|
}
|
|
2809
2810
|
function isEqualBlock(a, b) {
|
|
2810
|
-
if (!a && !b)
|
|
2811
|
-
|
|
2812
|
-
if (
|
|
2813
|
-
|
|
2814
|
-
if (a.src && b.src && a.src === b.src)
|
|
2815
|
-
return true;
|
|
2816
|
-
if (a.content !== b.content)
|
|
2817
|
-
return false;
|
|
2811
|
+
if (!a && !b) return true;
|
|
2812
|
+
if (!a || !b) return false;
|
|
2813
|
+
if (a.src && b.src && a.src === b.src) return true;
|
|
2814
|
+
if (a.content !== b.content) return false;
|
|
2818
2815
|
const keysA = Object.keys(a.attrs);
|
|
2819
2816
|
const keysB = Object.keys(b.attrs);
|
|
2820
2817
|
if (keysA.length !== keysB.length) {
|
|
@@ -3063,8 +3060,7 @@ export default (sfc, props) => {
|
|
|
3063
3060
|
);
|
|
3064
3061
|
const offset = (scriptCode.match(/\r?\n/g)?.length ?? 0) + 1;
|
|
3065
3062
|
eachMapping(tracer, (m) => {
|
|
3066
|
-
if (m.source == null)
|
|
3067
|
-
return;
|
|
3063
|
+
if (m.source == null) return;
|
|
3068
3064
|
addMapping(gen, {
|
|
3069
3065
|
source: m.source,
|
|
3070
3066
|
original: { line: m.originalLine, column: m.originalColumn },
|
|
@@ -3154,7 +3150,8 @@ export default (sfc, props) => {
|
|
|
3154
3150
|
}
|
|
3155
3151
|
}
|
|
3156
3152
|
async function genScriptCode(descriptor, options, pluginContext, ssr, customElement) {
|
|
3157
|
-
|
|
3153
|
+
const vaporFlag = descriptor.vapor ? "__vapor: true" : "";
|
|
3154
|
+
let scriptCode = `const ${scriptIdentifier} = { ${vaporFlag} }`;
|
|
3158
3155
|
let map;
|
|
3159
3156
|
const script = resolveScript(descriptor, options, ssr, customElement);
|
|
3160
3157
|
if (script) {
|
|
@@ -3223,7 +3220,7 @@ export * from ${request}`;
|
|
|
3223
3220
|
style.module
|
|
3224
3221
|
);
|
|
3225
3222
|
stylesCode += importCode;
|
|
3226
|
-
Object.assign(cssModulesMap
|
|
3223
|
+
Object.assign(cssModulesMap ||= {}, nameMap);
|
|
3227
3224
|
} else {
|
|
3228
3225
|
if (customElement) {
|
|
3229
3226
|
stylesCode += `
|
|
@@ -3351,7 +3348,12 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
|
|
|
3351
3348
|
) : { mappings: "" };
|
|
3352
3349
|
return {
|
|
3353
3350
|
code: result.code,
|
|
3354
|
-
map
|
|
3351
|
+
map,
|
|
3352
|
+
meta: block.scoped && !descriptor.isTemp ? {
|
|
3353
|
+
vite: {
|
|
3354
|
+
cssScopeTo: [descriptor.filename, "default"]
|
|
3355
|
+
}
|
|
3356
|
+
} : void 0
|
|
3355
3357
|
};
|
|
3356
3358
|
}
|
|
3357
3359
|
function vuePlugin2(rawOptions = {}) {
|
|
@@ -3374,6 +3376,7 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
|
|
|
3374
3376
|
const customElement = options.value.features?.customElement || options.value.customElement;
|
|
3375
3377
|
return typeof customElement === "boolean" ? () => customElement : vite.createFilter(customElement);
|
|
3376
3378
|
});
|
|
3379
|
+
let transformCachedModule = false;
|
|
3377
3380
|
return {
|
|
3378
3381
|
name: "vite:vue",
|
|
3379
3382
|
api: {
|
|
@@ -3394,26 +3397,42 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
|
|
|
3394
3397
|
if (options.value.compiler.invalidateTypeCache) {
|
|
3395
3398
|
options.value.compiler.invalidateTypeCache(ctx.file);
|
|
3396
3399
|
}
|
|
3400
|
+
let typeDepModules;
|
|
3401
|
+
const matchesFilter = filter3.value(ctx.file);
|
|
3397
3402
|
if (typeDepToSFCMap.has(ctx.file)) {
|
|
3398
|
-
|
|
3403
|
+
typeDepModules = handleTypeDepChange(
|
|
3404
|
+
typeDepToSFCMap.get(ctx.file),
|
|
3405
|
+
ctx
|
|
3406
|
+
);
|
|
3407
|
+
if (!matchesFilter) return typeDepModules;
|
|
3399
3408
|
}
|
|
3400
|
-
if (
|
|
3409
|
+
if (matchesFilter) {
|
|
3401
3410
|
return handleHotUpdate(
|
|
3402
3411
|
ctx,
|
|
3403
3412
|
options.value,
|
|
3404
|
-
customElementFilter.value(ctx.file)
|
|
3413
|
+
customElementFilter.value(ctx.file),
|
|
3414
|
+
typeDepModules
|
|
3405
3415
|
);
|
|
3406
3416
|
}
|
|
3407
3417
|
},
|
|
3408
3418
|
config(config) {
|
|
3419
|
+
const parseDefine = (v) => {
|
|
3420
|
+
try {
|
|
3421
|
+
return typeof v === "string" ? JSON.parse(v) : v;
|
|
3422
|
+
} catch (err) {
|
|
3423
|
+
return v;
|
|
3424
|
+
}
|
|
3425
|
+
};
|
|
3409
3426
|
return {
|
|
3410
3427
|
resolve: {
|
|
3411
3428
|
dedupe: config.build?.ssr ? [] : ["vue"]
|
|
3412
3429
|
},
|
|
3413
3430
|
define: {
|
|
3414
|
-
__VUE_OPTIONS_API__:
|
|
3415
|
-
__VUE_PROD_DEVTOOLS__:
|
|
3416
|
-
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__:
|
|
3431
|
+
__VUE_OPTIONS_API__: options.value.features?.optionsAPI ?? parseDefine(config.define?.__VUE_OPTIONS_API__) ?? true,
|
|
3432
|
+
__VUE_PROD_DEVTOOLS__: (options.value.features?.prodDevtools || parseDefine(config.define?.__VUE_PROD_DEVTOOLS__)) ?? false,
|
|
3433
|
+
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: (options.value.features?.prodHydrationMismatchDetails || parseDefine(
|
|
3434
|
+
config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__
|
|
3435
|
+
)) ?? false
|
|
3417
3436
|
},
|
|
3418
3437
|
ssr: {
|
|
3419
3438
|
// @ts-ignore -- config.legacy.buildSsrCjsExternalHeuristics will be removed in Vite 5
|
|
@@ -3430,6 +3449,23 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
|
|
|
3430
3449
|
isProduction: config.isProduction,
|
|
3431
3450
|
devToolsEnabled: !!(options.value.features?.prodDevtools || config.define.__VUE_PROD_DEVTOOLS__ || !config.isProduction)
|
|
3432
3451
|
};
|
|
3452
|
+
const _warn = config.logger.warn;
|
|
3453
|
+
config.logger.warn = (...args) => {
|
|
3454
|
+
const msg = args[0];
|
|
3455
|
+
if (msg.match(
|
|
3456
|
+
/\[lightningcss\] '(deep|slotted|global)' is not recognized as a valid pseudo-/
|
|
3457
|
+
)) {
|
|
3458
|
+
return;
|
|
3459
|
+
}
|
|
3460
|
+
_warn(...args);
|
|
3461
|
+
};
|
|
3462
|
+
transformCachedModule = config.command === "build" && options.value.sourceMap && config.build.watch != null;
|
|
3463
|
+
},
|
|
3464
|
+
shouldTransformCachedModule({ id }) {
|
|
3465
|
+
if (transformCachedModule && parseVueRequest(id).query.vue) {
|
|
3466
|
+
return true;
|
|
3467
|
+
}
|
|
3468
|
+
return false;
|
|
3433
3469
|
},
|
|
3434
3470
|
configureServer(server) {
|
|
3435
3471
|
options.value.devServer = server;
|
|
@@ -3451,10 +3487,10 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
|
|
|
3451
3487
|
}
|
|
3452
3488
|
},
|
|
3453
3489
|
load(id, opt) {
|
|
3454
|
-
const ssr = opt?.ssr === true;
|
|
3455
3490
|
if (id === EXPORT_HELPER_ID) {
|
|
3456
3491
|
return helperCode;
|
|
3457
3492
|
}
|
|
3493
|
+
const ssr = opt?.ssr === true;
|
|
3458
3494
|
const { filename, query } = parseVueRequest(id);
|
|
3459
3495
|
if (query.vue) {
|
|
3460
3496
|
if (query.src) {
|
|
@@ -3504,6 +3540,9 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
|
|
|
3504
3540
|
);
|
|
3505
3541
|
} else {
|
|
3506
3542
|
const descriptor = query.src ? getSrcDescriptor(filename, query) || getTempSrcDescriptor(filename, query) : getDescriptor(filename, options.value);
|
|
3543
|
+
if (query.src) {
|
|
3544
|
+
this.addWatchFile(filename);
|
|
3545
|
+
}
|
|
3507
3546
|
if (query.type === "template") {
|
|
3508
3547
|
return transformTemplateAsModule(
|
|
3509
3548
|
code,
|
package/dist/vite.config.mjs
CHANGED
|
@@ -3133,7 +3133,7 @@ import path from "node:path";
|
|
|
3133
3133
|
import crypto from "node:crypto";
|
|
3134
3134
|
import require$$0 from "tty";
|
|
3135
3135
|
import require$$1 from "util";
|
|
3136
|
-
var version = "5.2.
|
|
3136
|
+
var version = "5.2.3";
|
|
3137
3137
|
function resolveCompiler(root) {
|
|
3138
3138
|
const compiler = tryResolveCompiler(root) || tryResolveCompiler();
|
|
3139
3139
|
if (!compiler) {
|
|
@@ -3261,7 +3261,8 @@ function getTempSrcDescriptor(filename, query) {
|
|
|
3261
3261
|
start: { line: 0, column: 0 }
|
|
3262
3262
|
}
|
|
3263
3263
|
}
|
|
3264
|
-
]
|
|
3264
|
+
],
|
|
3265
|
+
isTemp: true
|
|
3265
3266
|
};
|
|
3266
3267
|
}
|
|
3267
3268
|
function setSrcDescriptor(filename, entry, scoped) {
|
|
@@ -3415,6 +3416,8 @@ function resolveTemplateCompilerOptions(descriptor, options, ssr) {
|
|
|
3415
3416
|
}
|
|
3416
3417
|
return {
|
|
3417
3418
|
...options.template,
|
|
3419
|
+
// @ts-expect-error TODO remove when 3.6 is out
|
|
3420
|
+
vapor: descriptor.vapor,
|
|
3418
3421
|
id,
|
|
3419
3422
|
ast: canReuseAST(options.compiler.version) ? descriptor.template?.ast : void 0,
|
|
3420
3423
|
filename,
|
|
@@ -3477,8 +3480,7 @@ function resolveScript(descriptor, options, ssr, customElement) {
|
|
|
3477
3480
|
if (cached) {
|
|
3478
3481
|
return cached;
|
|
3479
3482
|
}
|
|
3480
|
-
|
|
3481
|
-
resolved = options.compiler.compileScript(descriptor, {
|
|
3483
|
+
const resolved = options.compiler.compileScript(descriptor, {
|
|
3482
3484
|
...options.script,
|
|
3483
3485
|
id: descriptor.id,
|
|
3484
3486
|
isProd: options.isProduction,
|
|
@@ -4003,10 +4005,6 @@ function put(setarr, key) {
|
|
|
4003
4005
|
return indexes[key] = length - 1;
|
|
4004
4006
|
}
|
|
4005
4007
|
var COLUMN = 0;
|
|
4006
|
-
var SOURCES_INDEX = 1;
|
|
4007
|
-
var SOURCE_LINE = 2;
|
|
4008
|
-
var SOURCE_COLUMN = 3;
|
|
4009
|
-
var NAMES_INDEX = 4;
|
|
4010
4008
|
var NO_NAME = -1;
|
|
4011
4009
|
var GenMapping = class {
|
|
4012
4010
|
constructor({ file, sourceRoot } = {}) {
|
|
@@ -4059,17 +4057,12 @@ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLin
|
|
|
4059
4057
|
const line = getLine(mappings, genLine);
|
|
4060
4058
|
const index = getColumnIndex(line, genColumn);
|
|
4061
4059
|
if (!source) {
|
|
4062
|
-
if (skipable && skipSourceless(line, index))
|
|
4063
|
-
return;
|
|
4064
4060
|
return insert(line, index, [genColumn]);
|
|
4065
4061
|
}
|
|
4066
4062
|
const sourcesIndex = put(sources, source);
|
|
4067
4063
|
const namesIndex = name ? put(names, name) : NO_NAME;
|
|
4068
4064
|
if (sourcesIndex === sourcesContent.length)
|
|
4069
4065
|
sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null;
|
|
4070
|
-
if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
|
|
4071
|
-
return;
|
|
4072
|
-
}
|
|
4073
4066
|
return insert(line, index, name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn]);
|
|
4074
4067
|
}
|
|
4075
4068
|
function getLine(mappings, index) {
|
|
@@ -4107,20 +4100,6 @@ function putAll(setarr, array) {
|
|
|
4107
4100
|
for (let i = 0; i < array.length; i++)
|
|
4108
4101
|
put(setarr, array[i]);
|
|
4109
4102
|
}
|
|
4110
|
-
function skipSourceless(line, index) {
|
|
4111
|
-
if (index === 0)
|
|
4112
|
-
return true;
|
|
4113
|
-
const prev = line[index - 1];
|
|
4114
|
-
return prev.length === 1;
|
|
4115
|
-
}
|
|
4116
|
-
function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
|
|
4117
|
-
if (index === 0)
|
|
4118
|
-
return false;
|
|
4119
|
-
const prev = line[index - 1];
|
|
4120
|
-
if (prev.length === 1)
|
|
4121
|
-
return false;
|
|
4122
|
-
return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME);
|
|
4123
|
-
}
|
|
4124
4103
|
function addMappingInternal(skipable, map, mapping2) {
|
|
4125
4104
|
const { generated, source, original, name, content } = mapping2;
|
|
4126
4105
|
if (!source) {
|
|
@@ -4355,50 +4334,64 @@ function requireCommon() {
|
|
|
4355
4334
|
createDebug.namespaces = namespaces;
|
|
4356
4335
|
createDebug.names = [];
|
|
4357
4336
|
createDebug.skips = [];
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4337
|
+
const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
|
|
4338
|
+
for (const ns of split) {
|
|
4339
|
+
if (ns[0] === "-") {
|
|
4340
|
+
createDebug.skips.push(ns.slice(1));
|
|
4341
|
+
} else {
|
|
4342
|
+
createDebug.names.push(ns);
|
|
4364
4343
|
}
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4344
|
+
}
|
|
4345
|
+
}
|
|
4346
|
+
function matchesTemplate(search, template) {
|
|
4347
|
+
let searchIndex = 0;
|
|
4348
|
+
let templateIndex = 0;
|
|
4349
|
+
let starIndex = -1;
|
|
4350
|
+
let matchIndex = 0;
|
|
4351
|
+
while (searchIndex < search.length) {
|
|
4352
|
+
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
|
|
4353
|
+
if (template[templateIndex] === "*") {
|
|
4354
|
+
starIndex = templateIndex;
|
|
4355
|
+
matchIndex = searchIndex;
|
|
4356
|
+
templateIndex++;
|
|
4357
|
+
} else {
|
|
4358
|
+
searchIndex++;
|
|
4359
|
+
templateIndex++;
|
|
4360
|
+
}
|
|
4361
|
+
} else if (starIndex !== -1) {
|
|
4362
|
+
templateIndex = starIndex + 1;
|
|
4363
|
+
matchIndex++;
|
|
4364
|
+
searchIndex = matchIndex;
|
|
4368
4365
|
} else {
|
|
4369
|
-
|
|
4366
|
+
return false;
|
|
4370
4367
|
}
|
|
4371
4368
|
}
|
|
4369
|
+
while (templateIndex < template.length && template[templateIndex] === "*") {
|
|
4370
|
+
templateIndex++;
|
|
4371
|
+
}
|
|
4372
|
+
return templateIndex === template.length;
|
|
4372
4373
|
}
|
|
4373
4374
|
function disable() {
|
|
4374
4375
|
const namespaces = [
|
|
4375
|
-
...createDebug.names
|
|
4376
|
-
...createDebug.skips.map(
|
|
4376
|
+
...createDebug.names,
|
|
4377
|
+
...createDebug.skips.map((namespace) => "-" + namespace)
|
|
4377
4378
|
].join(",");
|
|
4378
4379
|
createDebug.enable("");
|
|
4379
4380
|
return namespaces;
|
|
4380
4381
|
}
|
|
4381
4382
|
function enabled(name) {
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
}
|
|
4385
|
-
let i;
|
|
4386
|
-
let len;
|
|
4387
|
-
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
|
4388
|
-
if (createDebug.skips[i].test(name)) {
|
|
4383
|
+
for (const skip of createDebug.skips) {
|
|
4384
|
+
if (matchesTemplate(name, skip)) {
|
|
4389
4385
|
return false;
|
|
4390
4386
|
}
|
|
4391
4387
|
}
|
|
4392
|
-
for (
|
|
4393
|
-
if (
|
|
4388
|
+
for (const ns of createDebug.names) {
|
|
4389
|
+
if (matchesTemplate(name, ns)) {
|
|
4394
4390
|
return true;
|
|
4395
4391
|
}
|
|
4396
4392
|
}
|
|
4397
4393
|
return false;
|
|
4398
4394
|
}
|
|
4399
|
-
function toNamespace(regexp) {
|
|
4400
|
-
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
|
|
4401
|
-
}
|
|
4402
4395
|
function coerce(val) {
|
|
4403
4396
|
if (val instanceof Error) {
|
|
4404
4397
|
return val.stack || val.message;
|
|
@@ -4763,16 +4756,22 @@ function requireNode() {
|
|
|
4763
4756
|
})(node, node.exports);
|
|
4764
4757
|
return node.exports;
|
|
4765
4758
|
}
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4759
|
+
var hasRequiredSrc;
|
|
4760
|
+
function requireSrc() {
|
|
4761
|
+
if (hasRequiredSrc) return src.exports;
|
|
4762
|
+
hasRequiredSrc = 1;
|
|
4763
|
+
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
4764
|
+
src.exports = requireBrowser();
|
|
4765
|
+
} else {
|
|
4766
|
+
src.exports = requireNode();
|
|
4767
|
+
}
|
|
4768
|
+
return src.exports;
|
|
4770
4769
|
}
|
|
4771
|
-
var srcExports =
|
|
4770
|
+
var srcExports = requireSrc();
|
|
4772
4771
|
var _debug = /* @__PURE__ */ getDefaultExportFromCjs(srcExports);
|
|
4773
4772
|
var debug = _debug("vite:hmr");
|
|
4774
4773
|
var directRequestRE = /(?:\?|&)direct\b/;
|
|
4775
|
-
async function handleHotUpdate({ file, modules, read }, options, customElement) {
|
|
4774
|
+
async function handleHotUpdate({ file, modules, read }, options, customElement, typeDepModules) {
|
|
4776
4775
|
const prevDescriptor = getDescriptor(file, options, false, true);
|
|
4777
4776
|
if (!prevDescriptor) {
|
|
4778
4777
|
return;
|
|
@@ -4873,17 +4872,15 @@ async function handleHotUpdate({ file, modules, read }, options, customElement)
|
|
|
4873
4872
|
}
|
|
4874
4873
|
debug(`[vue:update(${updateType.join("&")})] ${file}`);
|
|
4875
4874
|
}
|
|
4876
|
-
return [...affectedModules].filter(
|
|
4875
|
+
return [...affectedModules, ...typeDepModules || []].filter(
|
|
4876
|
+
Boolean
|
|
4877
|
+
);
|
|
4877
4878
|
}
|
|
4878
4879
|
function isEqualBlock(a, b) {
|
|
4879
|
-
if (!a && !b)
|
|
4880
|
-
|
|
4881
|
-
if (
|
|
4882
|
-
|
|
4883
|
-
if (a.src && b.src && a.src === b.src)
|
|
4884
|
-
return true;
|
|
4885
|
-
if (a.content !== b.content)
|
|
4886
|
-
return false;
|
|
4880
|
+
if (!a && !b) return true;
|
|
4881
|
+
if (!a || !b) return false;
|
|
4882
|
+
if (a.src && b.src && a.src === b.src) return true;
|
|
4883
|
+
if (a.content !== b.content) return false;
|
|
4887
4884
|
const keysA = Object.keys(a.attrs);
|
|
4888
4885
|
const keysB = Object.keys(b.attrs);
|
|
4889
4886
|
if (keysA.length !== keysB.length) {
|
|
@@ -5132,8 +5129,7 @@ async function transformMain(code, filename, options, pluginContext, ssr, custom
|
|
|
5132
5129
|
);
|
|
5133
5130
|
const offset = (scriptCode.match(/\r?\n/g)?.length ?? 0) + 1;
|
|
5134
5131
|
eachMapping(tracer, (m) => {
|
|
5135
|
-
if (m.source == null)
|
|
5136
|
-
return;
|
|
5132
|
+
if (m.source == null) return;
|
|
5137
5133
|
addMapping(gen, {
|
|
5138
5134
|
source: m.source,
|
|
5139
5135
|
original: { line: m.originalLine, column: m.originalColumn },
|
|
@@ -5223,7 +5219,8 @@ async function genTemplateCode(descriptor, options, pluginContext, ssr, customEl
|
|
|
5223
5219
|
}
|
|
5224
5220
|
}
|
|
5225
5221
|
async function genScriptCode(descriptor, options, pluginContext, ssr, customElement) {
|
|
5226
|
-
|
|
5222
|
+
const vaporFlag = descriptor.vapor ? "__vapor: true" : "";
|
|
5223
|
+
let scriptCode = `const ${scriptIdentifier} = { ${vaporFlag} }`;
|
|
5227
5224
|
let map;
|
|
5228
5225
|
const script = resolveScript(descriptor, options, ssr, customElement);
|
|
5229
5226
|
if (script) {
|
|
@@ -5292,7 +5289,7 @@ async function genStyleCode(descriptor, pluginContext, customElement, attachedPr
|
|
|
5292
5289
|
style.module
|
|
5293
5290
|
);
|
|
5294
5291
|
stylesCode += importCode;
|
|
5295
|
-
Object.assign(cssModulesMap
|
|
5292
|
+
Object.assign(cssModulesMap ||= {}, nameMap);
|
|
5296
5293
|
} else {
|
|
5297
5294
|
if (customElement) {
|
|
5298
5295
|
stylesCode += `
|
|
@@ -5420,7 +5417,12 @@ async function transformStyle(code, descriptor, index, options, pluginContext, f
|
|
|
5420
5417
|
) : { mappings: "" };
|
|
5421
5418
|
return {
|
|
5422
5419
|
code: result.code,
|
|
5423
|
-
map
|
|
5420
|
+
map,
|
|
5421
|
+
meta: block.scoped && !descriptor.isTemp ? {
|
|
5422
|
+
vite: {
|
|
5423
|
+
cssScopeTo: [descriptor.filename, "default"]
|
|
5424
|
+
}
|
|
5425
|
+
} : void 0
|
|
5424
5426
|
};
|
|
5425
5427
|
}
|
|
5426
5428
|
function vuePlugin(rawOptions = {}) {
|
|
@@ -5443,6 +5445,7 @@ function vuePlugin(rawOptions = {}) {
|
|
|
5443
5445
|
const customElement = options.value.features?.customElement || options.value.customElement;
|
|
5444
5446
|
return typeof customElement === "boolean" ? () => customElement : createFilter(customElement);
|
|
5445
5447
|
});
|
|
5448
|
+
let transformCachedModule = false;
|
|
5446
5449
|
return {
|
|
5447
5450
|
name: "vite:vue",
|
|
5448
5451
|
api: {
|
|
@@ -5463,26 +5466,42 @@ function vuePlugin(rawOptions = {}) {
|
|
|
5463
5466
|
if (options.value.compiler.invalidateTypeCache) {
|
|
5464
5467
|
options.value.compiler.invalidateTypeCache(ctx.file);
|
|
5465
5468
|
}
|
|
5469
|
+
let typeDepModules;
|
|
5470
|
+
const matchesFilter = filter3.value(ctx.file);
|
|
5466
5471
|
if (typeDepToSFCMap.has(ctx.file)) {
|
|
5467
|
-
|
|
5472
|
+
typeDepModules = handleTypeDepChange(
|
|
5473
|
+
typeDepToSFCMap.get(ctx.file),
|
|
5474
|
+
ctx
|
|
5475
|
+
);
|
|
5476
|
+
if (!matchesFilter) return typeDepModules;
|
|
5468
5477
|
}
|
|
5469
|
-
if (
|
|
5478
|
+
if (matchesFilter) {
|
|
5470
5479
|
return handleHotUpdate(
|
|
5471
5480
|
ctx,
|
|
5472
5481
|
options.value,
|
|
5473
|
-
customElementFilter.value(ctx.file)
|
|
5482
|
+
customElementFilter.value(ctx.file),
|
|
5483
|
+
typeDepModules
|
|
5474
5484
|
);
|
|
5475
5485
|
}
|
|
5476
5486
|
},
|
|
5477
5487
|
config(config) {
|
|
5488
|
+
const parseDefine = (v) => {
|
|
5489
|
+
try {
|
|
5490
|
+
return typeof v === "string" ? JSON.parse(v) : v;
|
|
5491
|
+
} catch (err) {
|
|
5492
|
+
return v;
|
|
5493
|
+
}
|
|
5494
|
+
};
|
|
5478
5495
|
return {
|
|
5479
5496
|
resolve: {
|
|
5480
5497
|
dedupe: config.build?.ssr ? [] : ["vue"]
|
|
5481
5498
|
},
|
|
5482
5499
|
define: {
|
|
5483
|
-
__VUE_OPTIONS_API__:
|
|
5484
|
-
__VUE_PROD_DEVTOOLS__:
|
|
5485
|
-
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__:
|
|
5500
|
+
__VUE_OPTIONS_API__: options.value.features?.optionsAPI ?? parseDefine(config.define?.__VUE_OPTIONS_API__) ?? true,
|
|
5501
|
+
__VUE_PROD_DEVTOOLS__: (options.value.features?.prodDevtools || parseDefine(config.define?.__VUE_PROD_DEVTOOLS__)) ?? false,
|
|
5502
|
+
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: (options.value.features?.prodHydrationMismatchDetails || parseDefine(
|
|
5503
|
+
config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__
|
|
5504
|
+
)) ?? false
|
|
5486
5505
|
},
|
|
5487
5506
|
ssr: {
|
|
5488
5507
|
// @ts-ignore -- config.legacy.buildSsrCjsExternalHeuristics will be removed in Vite 5
|
|
@@ -5499,6 +5518,23 @@ function vuePlugin(rawOptions = {}) {
|
|
|
5499
5518
|
isProduction: config.isProduction,
|
|
5500
5519
|
devToolsEnabled: !!(options.value.features?.prodDevtools || config.define.__VUE_PROD_DEVTOOLS__ || !config.isProduction)
|
|
5501
5520
|
};
|
|
5521
|
+
const _warn = config.logger.warn;
|
|
5522
|
+
config.logger.warn = (...args) => {
|
|
5523
|
+
const msg = args[0];
|
|
5524
|
+
if (msg.match(
|
|
5525
|
+
/\[lightningcss\] '(deep|slotted|global)' is not recognized as a valid pseudo-/
|
|
5526
|
+
)) {
|
|
5527
|
+
return;
|
|
5528
|
+
}
|
|
5529
|
+
_warn(...args);
|
|
5530
|
+
};
|
|
5531
|
+
transformCachedModule = config.command === "build" && options.value.sourceMap && config.build.watch != null;
|
|
5532
|
+
},
|
|
5533
|
+
shouldTransformCachedModule({ id }) {
|
|
5534
|
+
if (transformCachedModule && parseVueRequest(id).query.vue) {
|
|
5535
|
+
return true;
|
|
5536
|
+
}
|
|
5537
|
+
return false;
|
|
5502
5538
|
},
|
|
5503
5539
|
configureServer(server) {
|
|
5504
5540
|
options.value.devServer = server;
|
|
@@ -5520,10 +5556,10 @@ function vuePlugin(rawOptions = {}) {
|
|
|
5520
5556
|
}
|
|
5521
5557
|
},
|
|
5522
5558
|
load(id, opt) {
|
|
5523
|
-
const ssr = opt?.ssr === true;
|
|
5524
5559
|
if (id === EXPORT_HELPER_ID) {
|
|
5525
5560
|
return helperCode;
|
|
5526
5561
|
}
|
|
5562
|
+
const ssr = opt?.ssr === true;
|
|
5527
5563
|
const { filename, query } = parseVueRequest(id);
|
|
5528
5564
|
if (query.vue) {
|
|
5529
5565
|
if (query.src) {
|
|
@@ -5573,6 +5609,9 @@ function vuePlugin(rawOptions = {}) {
|
|
|
5573
5609
|
);
|
|
5574
5610
|
} else {
|
|
5575
5611
|
const descriptor = query.src ? getSrcDescriptor(filename, query) || getTempSrcDescriptor(filename, query) : getDescriptor(filename, options.value);
|
|
5612
|
+
if (query.src) {
|
|
5613
|
+
this.addWatchFile(filename);
|
|
5614
|
+
}
|
|
5576
5615
|
if (query.type === "template") {
|
|
5577
5616
|
return transformTemplateAsModule(
|
|
5578
5617
|
code,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forsakringskassan/vite-lib-config",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.1",
|
|
4
4
|
"description": "Försäkringskassan toolchain to build libraries with Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dist"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@microsoft/api-extractor": "7.
|
|
45
|
+
"@microsoft/api-extractor": "7.52.1",
|
|
46
46
|
"@vue/babel-preset-app": "5.0.8"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|