@forsakringskassan/vite-lib-config 3.4.2 → 3.4.3
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 +63 -118
- package/dist/vite.config.mjs +59 -114
- package/package.json +2 -2
package/dist/tsdoc-metadata.json
CHANGED
package/dist/vite.config.cjs
CHANGED
|
@@ -336,11 +336,11 @@ var require_dist = __commonJS({
|
|
|
336
336
|
"node_modules/@vitejs/plugin-vue/dist/index.cjs"(exports2, module2) {
|
|
337
337
|
"use strict";
|
|
338
338
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
339
|
-
var
|
|
339
|
+
var fs4 = require("node:fs");
|
|
340
340
|
var vite = require("vite");
|
|
341
341
|
var vue = require("vue");
|
|
342
342
|
var node_module = require("node:module");
|
|
343
|
-
var
|
|
343
|
+
var path3 = require("node:path");
|
|
344
344
|
var crypto = require("node:crypto");
|
|
345
345
|
var require$$0 = require("tty");
|
|
346
346
|
var require$$1 = require("util");
|
|
@@ -348,8 +348,8 @@ var require_dist = __commonJS({
|
|
|
348
348
|
function _interopDefaultCompat(e) {
|
|
349
349
|
return e && typeof e === "object" && "default" in e ? e.default : e;
|
|
350
350
|
}
|
|
351
|
-
var fs__default = /* @__PURE__ */ _interopDefaultCompat(
|
|
352
|
-
var path__default = /* @__PURE__ */ _interopDefaultCompat(
|
|
351
|
+
var fs__default = /* @__PURE__ */ _interopDefaultCompat(fs4);
|
|
352
|
+
var path__default = /* @__PURE__ */ _interopDefaultCompat(path3);
|
|
353
353
|
var crypto__default = /* @__PURE__ */ _interopDefaultCompat(crypto);
|
|
354
354
|
var require$$0__default = /* @__PURE__ */ _interopDefaultCompat(require$$0);
|
|
355
355
|
var require$$1__default = /* @__PURE__ */ _interopDefaultCompat(require$$1);
|
|
@@ -498,12 +498,12 @@ var require_dist = __commonJS({
|
|
|
498
498
|
function getHash(text) {
|
|
499
499
|
return hash("sha256", text, "hex").substring(0, 8);
|
|
500
500
|
}
|
|
501
|
-
function slash(
|
|
502
|
-
const isExtendedLengthPath =
|
|
501
|
+
function slash(path4) {
|
|
502
|
+
const isExtendedLengthPath = path4.startsWith("\\\\?\\");
|
|
503
503
|
if (isExtendedLengthPath) {
|
|
504
|
-
return
|
|
504
|
+
return path4;
|
|
505
505
|
}
|
|
506
|
-
return
|
|
506
|
+
return path4.replace(/\\/g, "/");
|
|
507
507
|
}
|
|
508
508
|
function createRollupError(id, error) {
|
|
509
509
|
const { message, name, stack } = error;
|
|
@@ -939,16 +939,16 @@ import.meta.hot.accept(({ render }) => {
|
|
|
939
939
|
}
|
|
940
940
|
function parseFileUrl(input) {
|
|
941
941
|
const match2 = fileRegex.exec(input);
|
|
942
|
-
const
|
|
943
|
-
return makeUrl("file:", "", match2[1] || "", "", isAbsolutePath(
|
|
942
|
+
const path4 = match2[2];
|
|
943
|
+
return makeUrl("file:", "", match2[1] || "", "", isAbsolutePath(path4) ? path4 : "/" + path4, match2[3] || "", match2[4] || "");
|
|
944
944
|
}
|
|
945
|
-
function makeUrl(scheme, user, host, port,
|
|
945
|
+
function makeUrl(scheme, user, host, port, path4, query, hash2) {
|
|
946
946
|
return {
|
|
947
947
|
scheme,
|
|
948
948
|
user,
|
|
949
949
|
host,
|
|
950
950
|
port,
|
|
951
|
-
path:
|
|
951
|
+
path: path4,
|
|
952
952
|
query,
|
|
953
953
|
hash: hash2,
|
|
954
954
|
type: 7
|
|
@@ -978,11 +978,11 @@ import.meta.hot.accept(({ render }) => {
|
|
|
978
978
|
url.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1;
|
|
979
979
|
return url;
|
|
980
980
|
}
|
|
981
|
-
function stripPathFilename(
|
|
982
|
-
if (
|
|
983
|
-
return
|
|
984
|
-
const index =
|
|
985
|
-
return
|
|
981
|
+
function stripPathFilename(path4) {
|
|
982
|
+
if (path4.endsWith("/.."))
|
|
983
|
+
return path4;
|
|
984
|
+
const index = path4.lastIndexOf("/");
|
|
985
|
+
return path4.slice(0, index + 1);
|
|
986
986
|
}
|
|
987
987
|
function mergePaths(url, base) {
|
|
988
988
|
normalizePath(base, base.type);
|
|
@@ -1020,14 +1020,14 @@ import.meta.hot.accept(({ render }) => {
|
|
|
1020
1020
|
pieces[pointer++] = piece;
|
|
1021
1021
|
positive++;
|
|
1022
1022
|
}
|
|
1023
|
-
let
|
|
1023
|
+
let path4 = "";
|
|
1024
1024
|
for (let i = 1; i < pointer; i++) {
|
|
1025
|
-
|
|
1025
|
+
path4 += "/" + pieces[i];
|
|
1026
1026
|
}
|
|
1027
|
-
if (!
|
|
1028
|
-
|
|
1027
|
+
if (!path4 || addTrailingSlash && !path4.endsWith("/..")) {
|
|
1028
|
+
path4 += "/";
|
|
1029
1029
|
}
|
|
1030
|
-
url.path =
|
|
1030
|
+
url.path = path4;
|
|
1031
1031
|
}
|
|
1032
1032
|
function resolve$1(input, base) {
|
|
1033
1033
|
if (!input && !base)
|
|
@@ -1068,13 +1068,13 @@ import.meta.hot.accept(({ render }) => {
|
|
|
1068
1068
|
case 3:
|
|
1069
1069
|
return queryHash;
|
|
1070
1070
|
case 4: {
|
|
1071
|
-
const
|
|
1072
|
-
if (!
|
|
1071
|
+
const path4 = url.path.slice(1);
|
|
1072
|
+
if (!path4)
|
|
1073
1073
|
return queryHash || ".";
|
|
1074
|
-
if (isRelative(base || input) && !isRelative(
|
|
1075
|
-
return "./" +
|
|
1074
|
+
if (isRelative(base || input) && !isRelative(path4)) {
|
|
1075
|
+
return "./" + path4 + queryHash;
|
|
1076
1076
|
}
|
|
1077
|
-
return
|
|
1077
|
+
return path4 + queryHash;
|
|
1078
1078
|
}
|
|
1079
1079
|
case 5:
|
|
1080
1080
|
return url.path + queryHash;
|
|
@@ -1087,11 +1087,11 @@ import.meta.hot.accept(({ render }) => {
|
|
|
1087
1087
|
base += "/";
|
|
1088
1088
|
return resolve$1(input, base);
|
|
1089
1089
|
}
|
|
1090
|
-
function stripFilename(
|
|
1091
|
-
if (!
|
|
1090
|
+
function stripFilename(path4) {
|
|
1091
|
+
if (!path4)
|
|
1092
1092
|
return "";
|
|
1093
|
-
const index =
|
|
1094
|
-
return
|
|
1093
|
+
const index = path4.lastIndexOf("/");
|
|
1094
|
+
return path4.slice(0, index + 1);
|
|
1095
1095
|
}
|
|
1096
1096
|
var COLUMN$1 = 0;
|
|
1097
1097
|
function maybeSort(mappings, owned) {
|
|
@@ -5074,26 +5074,6 @@ function packageJsonPlugin() {
|
|
|
5074
5074
|
};
|
|
5075
5075
|
}
|
|
5076
5076
|
|
|
5077
|
-
// src/utils/detect-internal-dependencies.ts
|
|
5078
|
-
function detectInternalDependencies(packages2, dependencies2) {
|
|
5079
|
-
const internal = packages2.filter((pkg) => dependencies2.includes(pkg.name));
|
|
5080
|
-
const num = internal.length;
|
|
5081
|
-
console.group("Detecting monorepo dependencies:");
|
|
5082
|
-
if (num > 0) {
|
|
5083
|
-
const ies = num === 1 ? "y" : "ies";
|
|
5084
|
-
console.log(`${num} internal dependenc${ies} found.
|
|
5085
|
-
`);
|
|
5086
|
-
} else {
|
|
5087
|
-
console.log("No internal dependencies found");
|
|
5088
|
-
}
|
|
5089
|
-
console.groupEnd();
|
|
5090
|
-
return internal;
|
|
5091
|
-
}
|
|
5092
|
-
|
|
5093
|
-
// src/utils/detect-monorepo-packages.ts
|
|
5094
|
-
var import_fs2 = __toESM(require("fs"));
|
|
5095
|
-
var import_node_path3 = __toESM(require("node:path"));
|
|
5096
|
-
|
|
5097
5077
|
// node_modules/glob/node_modules/minimatch/dist/esm/index.js
|
|
5098
5078
|
var import_brace_expansion = __toESM(require_brace_expansion(), 1);
|
|
5099
5079
|
|
|
@@ -8851,12 +8831,12 @@ var PathBase = class {
|
|
|
8851
8831
|
/**
|
|
8852
8832
|
* Get the Path object referenced by the string path, resolved from this Path
|
|
8853
8833
|
*/
|
|
8854
|
-
resolve(
|
|
8855
|
-
if (!
|
|
8834
|
+
resolve(path3) {
|
|
8835
|
+
if (!path3) {
|
|
8856
8836
|
return this;
|
|
8857
8837
|
}
|
|
8858
|
-
const rootPath = this.getRootString(
|
|
8859
|
-
const dir =
|
|
8838
|
+
const rootPath = this.getRootString(path3);
|
|
8839
|
+
const dir = path3.substring(rootPath.length);
|
|
8860
8840
|
const dirParts = dir.split(this.splitSep);
|
|
8861
8841
|
const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
|
|
8862
8842
|
return result;
|
|
@@ -9608,8 +9588,8 @@ var PathWin32 = class _PathWin32 extends PathBase {
|
|
|
9608
9588
|
/**
|
|
9609
9589
|
* @internal
|
|
9610
9590
|
*/
|
|
9611
|
-
getRootString(
|
|
9612
|
-
return import_node_path2.win32.parse(
|
|
9591
|
+
getRootString(path3) {
|
|
9592
|
+
return import_node_path2.win32.parse(path3).root;
|
|
9613
9593
|
}
|
|
9614
9594
|
/**
|
|
9615
9595
|
* @internal
|
|
@@ -9655,8 +9635,8 @@ var PathPosix = class _PathPosix extends PathBase {
|
|
|
9655
9635
|
/**
|
|
9656
9636
|
* @internal
|
|
9657
9637
|
*/
|
|
9658
|
-
getRootString(
|
|
9659
|
-
return
|
|
9638
|
+
getRootString(path3) {
|
|
9639
|
+
return path3.startsWith("/") ? "/" : "";
|
|
9660
9640
|
}
|
|
9661
9641
|
/**
|
|
9662
9642
|
* @internal
|
|
@@ -9705,8 +9685,8 @@ var PathScurryBase = class {
|
|
|
9705
9685
|
*
|
|
9706
9686
|
* @internal
|
|
9707
9687
|
*/
|
|
9708
|
-
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs:
|
|
9709
|
-
this.#fs = fsFromOption(
|
|
9688
|
+
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs4 = defaultFS } = {}) {
|
|
9689
|
+
this.#fs = fsFromOption(fs4);
|
|
9710
9690
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
9711
9691
|
cwd = (0, import_node_url.fileURLToPath)(cwd);
|
|
9712
9692
|
}
|
|
@@ -9745,11 +9725,11 @@ var PathScurryBase = class {
|
|
|
9745
9725
|
/**
|
|
9746
9726
|
* Get the depth of a provided path, string, or the cwd
|
|
9747
9727
|
*/
|
|
9748
|
-
depth(
|
|
9749
|
-
if (typeof
|
|
9750
|
-
|
|
9728
|
+
depth(path3 = this.cwd) {
|
|
9729
|
+
if (typeof path3 === "string") {
|
|
9730
|
+
path3 = this.cwd.resolve(path3);
|
|
9751
9731
|
}
|
|
9752
|
-
return
|
|
9732
|
+
return path3.depth();
|
|
9753
9733
|
}
|
|
9754
9734
|
/**
|
|
9755
9735
|
* Return the cache of child entries. Exposed so subclasses can create
|
|
@@ -10236,9 +10216,9 @@ var PathScurryBase = class {
|
|
|
10236
10216
|
process2();
|
|
10237
10217
|
return results;
|
|
10238
10218
|
}
|
|
10239
|
-
chdir(
|
|
10219
|
+
chdir(path3 = this.cwd) {
|
|
10240
10220
|
const oldCwd = this.cwd;
|
|
10241
|
-
this.cwd = typeof
|
|
10221
|
+
this.cwd = typeof path3 === "string" ? this.cwd.resolve(path3) : path3;
|
|
10242
10222
|
this.cwd[setAsCwd](oldCwd);
|
|
10243
10223
|
}
|
|
10244
10224
|
};
|
|
@@ -10264,8 +10244,8 @@ var PathScurryWin32 = class extends PathScurryBase {
|
|
|
10264
10244
|
/**
|
|
10265
10245
|
* @internal
|
|
10266
10246
|
*/
|
|
10267
|
-
newRoot(
|
|
10268
|
-
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
10247
|
+
newRoot(fs4) {
|
|
10248
|
+
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs4 });
|
|
10269
10249
|
}
|
|
10270
10250
|
/**
|
|
10271
10251
|
* Return true if the provided path string is an absolute path
|
|
@@ -10293,8 +10273,8 @@ var PathScurryPosix = class extends PathScurryBase {
|
|
|
10293
10273
|
/**
|
|
10294
10274
|
* @internal
|
|
10295
10275
|
*/
|
|
10296
|
-
newRoot(
|
|
10297
|
-
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
10276
|
+
newRoot(fs4) {
|
|
10277
|
+
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs4 });
|
|
10298
10278
|
}
|
|
10299
10279
|
/**
|
|
10300
10280
|
* Return true if the provided path string is an absolute path
|
|
@@ -10594,8 +10574,8 @@ var MatchRecord = class {
|
|
|
10594
10574
|
}
|
|
10595
10575
|
// match, absolute, ifdir
|
|
10596
10576
|
entries() {
|
|
10597
|
-
return [...this.store.entries()].map(([
|
|
10598
|
-
|
|
10577
|
+
return [...this.store.entries()].map(([path3, n]) => [
|
|
10578
|
+
path3,
|
|
10599
10579
|
!!(n & 2),
|
|
10600
10580
|
!!(n & 1)
|
|
10601
10581
|
]);
|
|
@@ -10800,9 +10780,9 @@ var GlobUtil = class {
|
|
|
10800
10780
|
signal;
|
|
10801
10781
|
maxDepth;
|
|
10802
10782
|
includeChildMatches;
|
|
10803
|
-
constructor(patterns,
|
|
10783
|
+
constructor(patterns, path3, opts) {
|
|
10804
10784
|
this.patterns = patterns;
|
|
10805
|
-
this.path =
|
|
10785
|
+
this.path = path3;
|
|
10806
10786
|
this.opts = opts;
|
|
10807
10787
|
this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
|
|
10808
10788
|
this.includeChildMatches = opts.includeChildMatches !== false;
|
|
@@ -10821,11 +10801,11 @@ var GlobUtil = class {
|
|
|
10821
10801
|
});
|
|
10822
10802
|
}
|
|
10823
10803
|
}
|
|
10824
|
-
#ignored(
|
|
10825
|
-
return this.seen.has(
|
|
10804
|
+
#ignored(path3) {
|
|
10805
|
+
return this.seen.has(path3) || !!this.#ignore?.ignored?.(path3);
|
|
10826
10806
|
}
|
|
10827
|
-
#childrenIgnored(
|
|
10828
|
-
return !!this.#ignore?.childrenIgnored?.(
|
|
10807
|
+
#childrenIgnored(path3) {
|
|
10808
|
+
return !!this.#ignore?.childrenIgnored?.(path3);
|
|
10829
10809
|
}
|
|
10830
10810
|
// backpressure mechanism
|
|
10831
10811
|
pause() {
|
|
@@ -11040,8 +11020,8 @@ var GlobUtil = class {
|
|
|
11040
11020
|
};
|
|
11041
11021
|
var GlobWalker = class extends GlobUtil {
|
|
11042
11022
|
matches = /* @__PURE__ */ new Set();
|
|
11043
|
-
constructor(patterns,
|
|
11044
|
-
super(patterns,
|
|
11023
|
+
constructor(patterns, path3, opts) {
|
|
11024
|
+
super(patterns, path3, opts);
|
|
11045
11025
|
}
|
|
11046
11026
|
matchEmit(e) {
|
|
11047
11027
|
this.matches.add(e);
|
|
@@ -11078,8 +11058,8 @@ var GlobWalker = class extends GlobUtil {
|
|
|
11078
11058
|
};
|
|
11079
11059
|
var GlobStream = class extends GlobUtil {
|
|
11080
11060
|
results;
|
|
11081
|
-
constructor(patterns,
|
|
11082
|
-
super(patterns,
|
|
11061
|
+
constructor(patterns, path3, opts) {
|
|
11062
|
+
super(patterns, path3, opts);
|
|
11083
11063
|
this.results = new Minipass({
|
|
11084
11064
|
signal: this.signal,
|
|
11085
11065
|
objectMode: true
|
|
@@ -11378,28 +11358,6 @@ function readJsonFile(filename) {
|
|
|
11378
11358
|
return JSON.parse(import_node_fs2.default.readFileSync(filename, "utf-8"));
|
|
11379
11359
|
}
|
|
11380
11360
|
|
|
11381
|
-
// src/utils/detect-monorepo-packages.ts
|
|
11382
|
-
function detectMonorepoPackages(...pkgPaths) {
|
|
11383
|
-
for (const pkgPath of pkgPaths) {
|
|
11384
|
-
if (!import_fs2.default.existsSync(pkgPath)) {
|
|
11385
|
-
continue;
|
|
11386
|
-
}
|
|
11387
|
-
const rootDir = import_node_path3.default.dirname(pkgPath);
|
|
11388
|
-
const { workspaces } = readJsonFile(pkgPath);
|
|
11389
|
-
if (!workspaces) {
|
|
11390
|
-
continue;
|
|
11391
|
-
}
|
|
11392
|
-
return workspaces.map((it) => globSync(`${rootDir}/${it}/package.json`)).flat().map((filename) => {
|
|
11393
|
-
return {
|
|
11394
|
-
name: readJsonFile(filename).name,
|
|
11395
|
-
pkgPath: filename,
|
|
11396
|
-
srcPath: import_node_path3.default.resolve(import_node_path3.default.dirname(filename), "src")
|
|
11397
|
-
};
|
|
11398
|
-
});
|
|
11399
|
-
}
|
|
11400
|
-
return [];
|
|
11401
|
-
}
|
|
11402
|
-
|
|
11403
11361
|
// src/utils/detect-vue-major.ts
|
|
11404
11362
|
var import_semver = __toESM(require_semver2());
|
|
11405
11363
|
var import_vue = require("vue");
|
|
@@ -11576,11 +11534,6 @@ console.log(
|
|
|
11576
11534
|
`v${packageJson.version} (Vue ${vueMajor})`
|
|
11577
11535
|
);
|
|
11578
11536
|
console.log();
|
|
11579
|
-
var packages = detectMonorepoPackages("./package.json", "../../package.json");
|
|
11580
|
-
var internalDependencies = detectInternalDependencies(
|
|
11581
|
-
packages,
|
|
11582
|
-
allDependencies
|
|
11583
|
-
);
|
|
11584
11537
|
var defaultPlugins = [
|
|
11585
11538
|
indexHtmlPlugin(),
|
|
11586
11539
|
packageJsonPlugin(),
|
|
@@ -11591,14 +11544,6 @@ var defaultPlugins = [
|
|
|
11591
11544
|
var defaultConfig = {
|
|
11592
11545
|
fk: {},
|
|
11593
11546
|
plugins: defaultPlugins,
|
|
11594
|
-
optimizeDeps: {
|
|
11595
|
-
/**
|
|
11596
|
-
* Vite treats monorepo packages as sourcecode and performs no prebundling by default.
|
|
11597
|
-
* See https://vitejs.dev/guide/dep-pre-bundling.html#monorepos-and-linked-dependencies
|
|
11598
|
-
*/
|
|
11599
|
-
include: internalDependencies.map((it) => it.name),
|
|
11600
|
-
force: false
|
|
11601
|
-
},
|
|
11602
11547
|
build: {
|
|
11603
11548
|
emptyOutDir: false,
|
|
11604
11549
|
minify: false,
|
package/dist/vite.config.mjs
CHANGED
|
@@ -2566,12 +2566,12 @@ var hash = (
|
|
|
2566
2566
|
function getHash(text) {
|
|
2567
2567
|
return hash("sha256", text, "hex").substring(0, 8);
|
|
2568
2568
|
}
|
|
2569
|
-
function slash(
|
|
2570
|
-
const isExtendedLengthPath =
|
|
2569
|
+
function slash(path4) {
|
|
2570
|
+
const isExtendedLengthPath = path4.startsWith("\\\\?\\");
|
|
2571
2571
|
if (isExtendedLengthPath) {
|
|
2572
|
-
return
|
|
2572
|
+
return path4;
|
|
2573
2573
|
}
|
|
2574
|
-
return
|
|
2574
|
+
return path4.replace(/\\/g, "/");
|
|
2575
2575
|
}
|
|
2576
2576
|
function createRollupError(id, error) {
|
|
2577
2577
|
const { message, name, stack } = error;
|
|
@@ -3007,16 +3007,16 @@ function parseAbsoluteUrl(input) {
|
|
|
3007
3007
|
}
|
|
3008
3008
|
function parseFileUrl(input) {
|
|
3009
3009
|
const match2 = fileRegex.exec(input);
|
|
3010
|
-
const
|
|
3011
|
-
return makeUrl("file:", "", match2[1] || "", "", isAbsolutePath(
|
|
3010
|
+
const path4 = match2[2];
|
|
3011
|
+
return makeUrl("file:", "", match2[1] || "", "", isAbsolutePath(path4) ? path4 : "/" + path4, match2[3] || "", match2[4] || "");
|
|
3012
3012
|
}
|
|
3013
|
-
function makeUrl(scheme, user, host, port,
|
|
3013
|
+
function makeUrl(scheme, user, host, port, path4, query, hash2) {
|
|
3014
3014
|
return {
|
|
3015
3015
|
scheme,
|
|
3016
3016
|
user,
|
|
3017
3017
|
host,
|
|
3018
3018
|
port,
|
|
3019
|
-
path:
|
|
3019
|
+
path: path4,
|
|
3020
3020
|
query,
|
|
3021
3021
|
hash: hash2,
|
|
3022
3022
|
type: 7
|
|
@@ -3046,11 +3046,11 @@ function parseUrl(input) {
|
|
|
3046
3046
|
url.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1;
|
|
3047
3047
|
return url;
|
|
3048
3048
|
}
|
|
3049
|
-
function stripPathFilename(
|
|
3050
|
-
if (
|
|
3051
|
-
return
|
|
3052
|
-
const index =
|
|
3053
|
-
return
|
|
3049
|
+
function stripPathFilename(path4) {
|
|
3050
|
+
if (path4.endsWith("/.."))
|
|
3051
|
+
return path4;
|
|
3052
|
+
const index = path4.lastIndexOf("/");
|
|
3053
|
+
return path4.slice(0, index + 1);
|
|
3054
3054
|
}
|
|
3055
3055
|
function mergePaths(url, base) {
|
|
3056
3056
|
normalizePath(base, base.type);
|
|
@@ -3088,14 +3088,14 @@ function normalizePath(url, type) {
|
|
|
3088
3088
|
pieces[pointer++] = piece;
|
|
3089
3089
|
positive++;
|
|
3090
3090
|
}
|
|
3091
|
-
let
|
|
3091
|
+
let path4 = "";
|
|
3092
3092
|
for (let i = 1; i < pointer; i++) {
|
|
3093
|
-
|
|
3093
|
+
path4 += "/" + pieces[i];
|
|
3094
3094
|
}
|
|
3095
|
-
if (!
|
|
3096
|
-
|
|
3095
|
+
if (!path4 || addTrailingSlash && !path4.endsWith("/..")) {
|
|
3096
|
+
path4 += "/";
|
|
3097
3097
|
}
|
|
3098
|
-
url.path =
|
|
3098
|
+
url.path = path4;
|
|
3099
3099
|
}
|
|
3100
3100
|
function resolve$1(input, base) {
|
|
3101
3101
|
if (!input && !base)
|
|
@@ -3136,13 +3136,13 @@ function resolve$1(input, base) {
|
|
|
3136
3136
|
case 3:
|
|
3137
3137
|
return queryHash;
|
|
3138
3138
|
case 4: {
|
|
3139
|
-
const
|
|
3140
|
-
if (!
|
|
3139
|
+
const path4 = url.path.slice(1);
|
|
3140
|
+
if (!path4)
|
|
3141
3141
|
return queryHash || ".";
|
|
3142
|
-
if (isRelative(base || input) && !isRelative(
|
|
3143
|
-
return "./" +
|
|
3142
|
+
if (isRelative(base || input) && !isRelative(path4)) {
|
|
3143
|
+
return "./" + path4 + queryHash;
|
|
3144
3144
|
}
|
|
3145
|
-
return
|
|
3145
|
+
return path4 + queryHash;
|
|
3146
3146
|
}
|
|
3147
3147
|
case 5:
|
|
3148
3148
|
return url.path + queryHash;
|
|
@@ -3155,11 +3155,11 @@ function resolve(input, base) {
|
|
|
3155
3155
|
base += "/";
|
|
3156
3156
|
return resolve$1(input, base);
|
|
3157
3157
|
}
|
|
3158
|
-
function stripFilename(
|
|
3159
|
-
if (!
|
|
3158
|
+
function stripFilename(path4) {
|
|
3159
|
+
if (!path4)
|
|
3160
3160
|
return "";
|
|
3161
|
-
const index =
|
|
3162
|
-
return
|
|
3161
|
+
const index = path4.lastIndexOf("/");
|
|
3162
|
+
return path4.slice(0, index + 1);
|
|
3163
3163
|
}
|
|
3164
3164
|
var COLUMN$1 = 0;
|
|
3165
3165
|
function maybeSort(mappings, owned) {
|
|
@@ -5051,26 +5051,6 @@ function packageJsonPlugin() {
|
|
|
5051
5051
|
};
|
|
5052
5052
|
}
|
|
5053
5053
|
|
|
5054
|
-
// src/utils/detect-internal-dependencies.ts
|
|
5055
|
-
function detectInternalDependencies(packages2, dependencies2) {
|
|
5056
|
-
const internal = packages2.filter((pkg) => dependencies2.includes(pkg.name));
|
|
5057
|
-
const num = internal.length;
|
|
5058
|
-
console.group("Detecting monorepo dependencies:");
|
|
5059
|
-
if (num > 0) {
|
|
5060
|
-
const ies = num === 1 ? "y" : "ies";
|
|
5061
|
-
console.log(`${num} internal dependenc${ies} found.
|
|
5062
|
-
`);
|
|
5063
|
-
} else {
|
|
5064
|
-
console.log("No internal dependencies found");
|
|
5065
|
-
}
|
|
5066
|
-
console.groupEnd();
|
|
5067
|
-
return internal;
|
|
5068
|
-
}
|
|
5069
|
-
|
|
5070
|
-
// src/utils/detect-monorepo-packages.ts
|
|
5071
|
-
import fs5 from "fs";
|
|
5072
|
-
import path4 from "node:path";
|
|
5073
|
-
|
|
5074
5054
|
// node_modules/glob/node_modules/minimatch/dist/esm/index.js
|
|
5075
5055
|
var import_brace_expansion = __toESM(require_brace_expansion(), 1);
|
|
5076
5056
|
|
|
@@ -8828,12 +8808,12 @@ var PathBase = class {
|
|
|
8828
8808
|
/**
|
|
8829
8809
|
* Get the Path object referenced by the string path, resolved from this Path
|
|
8830
8810
|
*/
|
|
8831
|
-
resolve(
|
|
8832
|
-
if (!
|
|
8811
|
+
resolve(path4) {
|
|
8812
|
+
if (!path4) {
|
|
8833
8813
|
return this;
|
|
8834
8814
|
}
|
|
8835
|
-
const rootPath = this.getRootString(
|
|
8836
|
-
const dir =
|
|
8815
|
+
const rootPath = this.getRootString(path4);
|
|
8816
|
+
const dir = path4.substring(rootPath.length);
|
|
8837
8817
|
const dirParts = dir.split(this.splitSep);
|
|
8838
8818
|
const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
|
|
8839
8819
|
return result;
|
|
@@ -9585,8 +9565,8 @@ var PathWin32 = class _PathWin32 extends PathBase {
|
|
|
9585
9565
|
/**
|
|
9586
9566
|
* @internal
|
|
9587
9567
|
*/
|
|
9588
|
-
getRootString(
|
|
9589
|
-
return win32.parse(
|
|
9568
|
+
getRootString(path4) {
|
|
9569
|
+
return win32.parse(path4).root;
|
|
9590
9570
|
}
|
|
9591
9571
|
/**
|
|
9592
9572
|
* @internal
|
|
@@ -9632,8 +9612,8 @@ var PathPosix = class _PathPosix extends PathBase {
|
|
|
9632
9612
|
/**
|
|
9633
9613
|
* @internal
|
|
9634
9614
|
*/
|
|
9635
|
-
getRootString(
|
|
9636
|
-
return
|
|
9615
|
+
getRootString(path4) {
|
|
9616
|
+
return path4.startsWith("/") ? "/" : "";
|
|
9637
9617
|
}
|
|
9638
9618
|
/**
|
|
9639
9619
|
* @internal
|
|
@@ -9682,8 +9662,8 @@ var PathScurryBase = class {
|
|
|
9682
9662
|
*
|
|
9683
9663
|
* @internal
|
|
9684
9664
|
*/
|
|
9685
|
-
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs:
|
|
9686
|
-
this.#fs = fsFromOption(
|
|
9665
|
+
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs5 = defaultFS } = {}) {
|
|
9666
|
+
this.#fs = fsFromOption(fs5);
|
|
9687
9667
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
9688
9668
|
cwd = fileURLToPath(cwd);
|
|
9689
9669
|
}
|
|
@@ -9722,11 +9702,11 @@ var PathScurryBase = class {
|
|
|
9722
9702
|
/**
|
|
9723
9703
|
* Get the depth of a provided path, string, or the cwd
|
|
9724
9704
|
*/
|
|
9725
|
-
depth(
|
|
9726
|
-
if (typeof
|
|
9727
|
-
|
|
9705
|
+
depth(path4 = this.cwd) {
|
|
9706
|
+
if (typeof path4 === "string") {
|
|
9707
|
+
path4 = this.cwd.resolve(path4);
|
|
9728
9708
|
}
|
|
9729
|
-
return
|
|
9709
|
+
return path4.depth();
|
|
9730
9710
|
}
|
|
9731
9711
|
/**
|
|
9732
9712
|
* Return the cache of child entries. Exposed so subclasses can create
|
|
@@ -10213,9 +10193,9 @@ var PathScurryBase = class {
|
|
|
10213
10193
|
process2();
|
|
10214
10194
|
return results;
|
|
10215
10195
|
}
|
|
10216
|
-
chdir(
|
|
10196
|
+
chdir(path4 = this.cwd) {
|
|
10217
10197
|
const oldCwd = this.cwd;
|
|
10218
|
-
this.cwd = typeof
|
|
10198
|
+
this.cwd = typeof path4 === "string" ? this.cwd.resolve(path4) : path4;
|
|
10219
10199
|
this.cwd[setAsCwd](oldCwd);
|
|
10220
10200
|
}
|
|
10221
10201
|
};
|
|
@@ -10241,8 +10221,8 @@ var PathScurryWin32 = class extends PathScurryBase {
|
|
|
10241
10221
|
/**
|
|
10242
10222
|
* @internal
|
|
10243
10223
|
*/
|
|
10244
|
-
newRoot(
|
|
10245
|
-
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
10224
|
+
newRoot(fs5) {
|
|
10225
|
+
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs5 });
|
|
10246
10226
|
}
|
|
10247
10227
|
/**
|
|
10248
10228
|
* Return true if the provided path string is an absolute path
|
|
@@ -10270,8 +10250,8 @@ var PathScurryPosix = class extends PathScurryBase {
|
|
|
10270
10250
|
/**
|
|
10271
10251
|
* @internal
|
|
10272
10252
|
*/
|
|
10273
|
-
newRoot(
|
|
10274
|
-
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
10253
|
+
newRoot(fs5) {
|
|
10254
|
+
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs5 });
|
|
10275
10255
|
}
|
|
10276
10256
|
/**
|
|
10277
10257
|
* Return true if the provided path string is an absolute path
|
|
@@ -10571,8 +10551,8 @@ var MatchRecord = class {
|
|
|
10571
10551
|
}
|
|
10572
10552
|
// match, absolute, ifdir
|
|
10573
10553
|
entries() {
|
|
10574
|
-
return [...this.store.entries()].map(([
|
|
10575
|
-
|
|
10554
|
+
return [...this.store.entries()].map(([path4, n]) => [
|
|
10555
|
+
path4,
|
|
10576
10556
|
!!(n & 2),
|
|
10577
10557
|
!!(n & 1)
|
|
10578
10558
|
]);
|
|
@@ -10777,9 +10757,9 @@ var GlobUtil = class {
|
|
|
10777
10757
|
signal;
|
|
10778
10758
|
maxDepth;
|
|
10779
10759
|
includeChildMatches;
|
|
10780
|
-
constructor(patterns,
|
|
10760
|
+
constructor(patterns, path4, opts) {
|
|
10781
10761
|
this.patterns = patterns;
|
|
10782
|
-
this.path =
|
|
10762
|
+
this.path = path4;
|
|
10783
10763
|
this.opts = opts;
|
|
10784
10764
|
this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
|
|
10785
10765
|
this.includeChildMatches = opts.includeChildMatches !== false;
|
|
@@ -10798,11 +10778,11 @@ var GlobUtil = class {
|
|
|
10798
10778
|
});
|
|
10799
10779
|
}
|
|
10800
10780
|
}
|
|
10801
|
-
#ignored(
|
|
10802
|
-
return this.seen.has(
|
|
10781
|
+
#ignored(path4) {
|
|
10782
|
+
return this.seen.has(path4) || !!this.#ignore?.ignored?.(path4);
|
|
10803
10783
|
}
|
|
10804
|
-
#childrenIgnored(
|
|
10805
|
-
return !!this.#ignore?.childrenIgnored?.(
|
|
10784
|
+
#childrenIgnored(path4) {
|
|
10785
|
+
return !!this.#ignore?.childrenIgnored?.(path4);
|
|
10806
10786
|
}
|
|
10807
10787
|
// backpressure mechanism
|
|
10808
10788
|
pause() {
|
|
@@ -11017,8 +10997,8 @@ var GlobUtil = class {
|
|
|
11017
10997
|
};
|
|
11018
10998
|
var GlobWalker = class extends GlobUtil {
|
|
11019
10999
|
matches = /* @__PURE__ */ new Set();
|
|
11020
|
-
constructor(patterns,
|
|
11021
|
-
super(patterns,
|
|
11000
|
+
constructor(patterns, path4, opts) {
|
|
11001
|
+
super(patterns, path4, opts);
|
|
11022
11002
|
}
|
|
11023
11003
|
matchEmit(e) {
|
|
11024
11004
|
this.matches.add(e);
|
|
@@ -11055,8 +11035,8 @@ var GlobWalker = class extends GlobUtil {
|
|
|
11055
11035
|
};
|
|
11056
11036
|
var GlobStream = class extends GlobUtil {
|
|
11057
11037
|
results;
|
|
11058
|
-
constructor(patterns,
|
|
11059
|
-
super(patterns,
|
|
11038
|
+
constructor(patterns, path4, opts) {
|
|
11039
|
+
super(patterns, path4, opts);
|
|
11060
11040
|
this.results = new Minipass({
|
|
11061
11041
|
signal: this.signal,
|
|
11062
11042
|
objectMode: true
|
|
@@ -11355,28 +11335,6 @@ function readJsonFile(filename) {
|
|
|
11355
11335
|
return JSON.parse(fs4.readFileSync(filename, "utf-8"));
|
|
11356
11336
|
}
|
|
11357
11337
|
|
|
11358
|
-
// src/utils/detect-monorepo-packages.ts
|
|
11359
|
-
function detectMonorepoPackages(...pkgPaths) {
|
|
11360
|
-
for (const pkgPath of pkgPaths) {
|
|
11361
|
-
if (!fs5.existsSync(pkgPath)) {
|
|
11362
|
-
continue;
|
|
11363
|
-
}
|
|
11364
|
-
const rootDir = path4.dirname(pkgPath);
|
|
11365
|
-
const { workspaces } = readJsonFile(pkgPath);
|
|
11366
|
-
if (!workspaces) {
|
|
11367
|
-
continue;
|
|
11368
|
-
}
|
|
11369
|
-
return workspaces.map((it) => globSync(`${rootDir}/${it}/package.json`)).flat().map((filename) => {
|
|
11370
|
-
return {
|
|
11371
|
-
name: readJsonFile(filename).name,
|
|
11372
|
-
pkgPath: filename,
|
|
11373
|
-
srcPath: path4.resolve(path4.dirname(filename), "src")
|
|
11374
|
-
};
|
|
11375
|
-
});
|
|
11376
|
-
}
|
|
11377
|
-
return [];
|
|
11378
|
-
}
|
|
11379
|
-
|
|
11380
11338
|
// src/utils/detect-vue-major.ts
|
|
11381
11339
|
var import_semver = __toESM(require_semver2());
|
|
11382
11340
|
import { version as version2 } from "vue";
|
|
@@ -11555,11 +11513,6 @@ console.log(
|
|
|
11555
11513
|
`v${packageJson.version} (Vue ${vueMajor})`
|
|
11556
11514
|
);
|
|
11557
11515
|
console.log();
|
|
11558
|
-
var packages = detectMonorepoPackages("./package.json", "../../package.json");
|
|
11559
|
-
var internalDependencies = detectInternalDependencies(
|
|
11560
|
-
packages,
|
|
11561
|
-
allDependencies
|
|
11562
|
-
);
|
|
11563
11516
|
var defaultPlugins = [
|
|
11564
11517
|
indexHtmlPlugin(),
|
|
11565
11518
|
packageJsonPlugin(),
|
|
@@ -11570,14 +11523,6 @@ var defaultPlugins = [
|
|
|
11570
11523
|
var defaultConfig = {
|
|
11571
11524
|
fk: {},
|
|
11572
11525
|
plugins: defaultPlugins,
|
|
11573
|
-
optimizeDeps: {
|
|
11574
|
-
/**
|
|
11575
|
-
* Vite treats monorepo packages as sourcecode and performs no prebundling by default.
|
|
11576
|
-
* See https://vitejs.dev/guide/dep-pre-bundling.html#monorepos-and-linked-dependencies
|
|
11577
|
-
*/
|
|
11578
|
-
include: internalDependencies.map((it) => it.name),
|
|
11579
|
-
force: false
|
|
11580
|
-
},
|
|
11581
11526
|
build: {
|
|
11582
11527
|
emptyOutDir: false,
|
|
11583
11528
|
minify: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forsakringskassan/vite-lib-config",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.3",
|
|
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.50.0",
|
|
46
46
|
"@vue/babel-preset-app": "5.0.8"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|