@module-federation/vite 1.21.3 → 1.21.4
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/lib/{dtsConstants-CScOzmdO.js → dtsConstants-BsaLBaaK.js} +21 -17
- package/lib/index.js +580 -131
- package/lib/{pluginDts-C2bUY8h9.js → pluginDts-BhONN9dR.js} +1 -1
- package/lib/sharedKeyMatcher-DiUzRVH1.js +198 -0
- package/lib/{ssrEntryLoader-BMtjS_Vl.js → ssrEntryLoader-CqtaiDUp.js} +35 -10
- package/lib/{ssrVmStrategy-tpI6we9Q.js → ssrVmStrategy-D4KB-y3H.js} +3 -16
- package/lib/utils/ssrEntryLoader.js +1 -1
- package/package.json +1 -1
- package/lib/pathNormalization-CHct3UwV.js +0 -115
|
@@ -363,7 +363,6 @@ function resolveInstalledPackageJson(pkg, cwd, packageName, opts) {
|
|
|
363
363
|
};
|
|
364
364
|
const findPackageInPnpmStore = (startDir) => {
|
|
365
365
|
let currentDir = startDir;
|
|
366
|
-
const rootDir = path$1.parse(currentDir).root;
|
|
367
366
|
while (true) {
|
|
368
367
|
const pnpmStoreDir = path$1.join(currentDir, "node_modules", ".pnpm");
|
|
369
368
|
if (existsSync(pnpmStoreDir)) try {
|
|
@@ -373,21 +372,26 @@ function resolveInstalledPackageJson(pkg, cwd, packageName, opts) {
|
|
|
373
372
|
if (candidate?.packageJson.name === packageName) return candidate;
|
|
374
373
|
}
|
|
375
374
|
} catch {}
|
|
376
|
-
|
|
377
|
-
|
|
375
|
+
const parentDir = path$1.dirname(currentDir);
|
|
376
|
+
if (parentDir === currentDir) break;
|
|
377
|
+
currentDir = parentDir;
|
|
378
378
|
}
|
|
379
379
|
};
|
|
380
|
+
let resolvedPath;
|
|
380
381
|
try {
|
|
381
382
|
const projectRequire = createRequire(pathToFileURL(path$1.join(cwd, "package.json")));
|
|
382
|
-
let resolvedPath;
|
|
383
383
|
if (opts?.fromResolvedEntry) resolvedPath = opts.fromResolvedEntry;
|
|
384
384
|
else try {
|
|
385
385
|
resolvedPath = projectRequire.resolve(pkg);
|
|
386
386
|
} catch {
|
|
387
387
|
resolvedPath = projectRequire.resolve(packageName);
|
|
388
388
|
}
|
|
389
|
+
} catch {
|
|
390
|
+
resolvedPath = void 0;
|
|
391
|
+
}
|
|
392
|
+
if (resolvedPath !== void 0 && !path$1.isAbsolute(resolvedPath)) resolvedPath = void 0;
|
|
393
|
+
if (resolvedPath !== void 0) try {
|
|
389
394
|
let currentDir = path$1.dirname(resolvedPath);
|
|
390
|
-
const rootDir = path$1.parse(currentDir).root;
|
|
391
395
|
let matchingPackage;
|
|
392
396
|
while (true) {
|
|
393
397
|
const packageJsonPath = path$1.join(currentDir, "package.json");
|
|
@@ -408,21 +412,21 @@ function resolveInstalledPackageJson(pkg, cwd, packageName, opts) {
|
|
|
408
412
|
if (!(error instanceof SyntaxError)) throw error;
|
|
409
413
|
}
|
|
410
414
|
}
|
|
411
|
-
|
|
412
|
-
|
|
415
|
+
const parentDir = path$1.dirname(currentDir);
|
|
416
|
+
if (parentDir === currentDir) break;
|
|
417
|
+
currentDir = parentDir;
|
|
413
418
|
}
|
|
414
419
|
return matchingPackage;
|
|
415
|
-
} catch {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
}
|
|
424
|
-
return findPackageInPnpmStore(cwd);
|
|
420
|
+
} catch {}
|
|
421
|
+
let currentDir = cwd;
|
|
422
|
+
while (true) {
|
|
423
|
+
const directCandidate = tryReadPackageJson(path$1.join(currentDir, "node_modules", packageName, "package.json"));
|
|
424
|
+
if (directCandidate?.packageJson.name === packageName) return directCandidate;
|
|
425
|
+
const parentDir = path$1.dirname(currentDir);
|
|
426
|
+
if (parentDir === currentDir) break;
|
|
427
|
+
currentDir = parentDir;
|
|
425
428
|
}
|
|
429
|
+
return findPackageInPnpmStore(cwd);
|
|
426
430
|
}
|
|
427
431
|
function getInstalledPackageEntry(pkg, opts) {
|
|
428
432
|
const installed = getInstalledPackageJson(pkg, opts);
|