@module-federation/vite 1.21.1 → 1.21.2
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/README.md +2 -1
- package/lib/index.js +89 -18
- package/lib/{pathNormalization-DvgU8LIp.js → pathNormalization-CHct3UwV.js} +1 -5
- package/lib/{ssrEntryLoader-0NnTjWR1.js → ssrEntryLoader-BMtjS_Vl.js} +1 -1
- package/lib/{ssrVmStrategy-B0fCaHs5.js → ssrVmStrategy-tpI6we9Q.js} +2 -2
- package/lib/utils/ssrEntryLoader.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -167,7 +167,7 @@ export default defineConfig({
|
|
|
167
167
|
name: "host",
|
|
168
168
|
remotes: {
|
|
169
169
|
remote: {
|
|
170
|
-
type: "module", // type "var"
|
|
170
|
+
type: "module", // omitted object type defaults to "var" with a warning
|
|
171
171
|
name: "remote",
|
|
172
172
|
entry: "https://[...]/remoteEntry.js",
|
|
173
173
|
entryGlobalName: "remote",
|
|
@@ -237,6 +237,7 @@ export default defineConfig({
|
|
|
237
237
|
```
|
|
238
238
|
|
|
239
239
|
The host app configuration specifies its name, the filename of its exposed remote entry remoteEntry.js, and importantly, the configuration of the remote application to load.
|
|
240
|
+
Object remotes that omit `type` retain the legacy `"var"` default and emit a warning. Use `type: "module"` for Vite ESM remotes. Use `type: "var"` explicitly only for global-format remotes, such as Webpack/Rspack remotes or a Vite remote's `varFilename` output.
|
|
240
241
|
You can specify the place the host initialization file is injected with the **hostInitInjectLocation** option, which is described in the example code above.
|
|
241
242
|
The **moduleParseTimeout** option allows you to configure the maximum time to wait for module parsing during the build process.
|
|
242
243
|
The **moduleParseIdleTimeout** option is an alternative that resets the timer on every parsed module. It only fires when there has been no module activity for the configured duration, making it suitable for large codebases where the total build time exceeds the fixed timeout.
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as normalizePathForImport, r as rebaseImport } from "./buildPaths-BkaQHrd2.js";
|
|
2
2
|
import { a as getPackageDetectionCwd, c as getSharedCacheDescriptor, d as packageNameDecode, f as packageNameEncode, g as createModuleFederationError, h as sharedCacheHelperCode, i as getIsRolldown, l as hasPackageDependency, m as setPackageDetectionCwd, n as getInstalledPackageEntry, o as getPackageName, p as resolveImportPath, r as getInstalledPackageJson, s as getPackageNameFromNodeModulePath, u as isNuxtProjectRoot, v as mfWarn } from "./dtsConstants-DyJrx8ah.js";
|
|
3
|
-
import { a as getCommonSharedSubpaths, c as isNodeModulePath, d as normalizeNodeModulePath, f as resolvePublicPath, i as getCommonSharedSubpathFromNodeModulePath, l as isNuxtClientBase, n as filterId, o as getMatchingNodeModuleSubpath, r as getBasePath$1, s as isAssetLikeImport, t as ensureTrailingSlash, u as isViteOptimizableEntry } from "./pathNormalization-
|
|
3
|
+
import { a as getCommonSharedSubpaths, c as isNodeModulePath, d as normalizeNodeModulePath, f as resolvePublicPath, i as getCommonSharedSubpathFromNodeModulePath, l as isNuxtClientBase, n as filterId, o as getMatchingNodeModuleSubpath, r as getBasePath$1, s as isAssetLikeImport, t as ensureTrailingSlash, u as isViteOptimizableEntry } from "./pathNormalization-CHct3UwV.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import * as fs$2 from "fs";
|
|
6
6
|
import { existsSync, readFileSync, realpathSync, statSync, writeFileSync } from "fs";
|
|
@@ -522,8 +522,12 @@ function findModuleImportDescriptors(code) {
|
|
|
522
522
|
const dynamicPattern = /\bimport\s*\(\s*(?:\/\*[\s\S]*?\*\/\s*)?(["'])([^"']+)\1\s*\)/g;
|
|
523
523
|
const requirePattern = /\brequire\s*\(\s*(["'])([^"']+)\1\s*\)/g;
|
|
524
524
|
const sideEffectPattern = /\bimport\s*(["'])([^"']+)\1/g;
|
|
525
|
-
|
|
526
|
-
|
|
525
|
+
let match;
|
|
526
|
+
while (match = staticFromPattern.exec(code)) {
|
|
527
|
+
if (!codePositions[match.index]) {
|
|
528
|
+
staticFromPattern.lastIndex = match.index + 1;
|
|
529
|
+
continue;
|
|
530
|
+
}
|
|
527
531
|
descriptors.push({
|
|
528
532
|
kind: "static",
|
|
529
533
|
syntax: "import",
|
|
@@ -573,6 +577,7 @@ function sanitizeDevEntryPath(devEntryPath) {
|
|
|
573
577
|
*/
|
|
574
578
|
function rewriteEntryScripts(html, createProxySrc) {
|
|
575
579
|
return html.replace(/<script\b(?=[^>]*\btype=["']module["'])(?=[^>]*\bsrc=["'][^"']+["'])([^>]*)>/gi, (match, attrs) => {
|
|
580
|
+
if (/\svite-ignore(?:\s|=|\/|$)/i.test(attrs)) return match;
|
|
576
581
|
const srcMatch = attrs.match(/\bsrc=["']([^"']+)["']/i);
|
|
577
582
|
if (!srcMatch) return match;
|
|
578
583
|
const originalSrc = srcMatch[1];
|
|
@@ -617,6 +622,9 @@ function normalizeRemotes(remotes) {
|
|
|
617
622
|
});
|
|
618
623
|
return result;
|
|
619
624
|
}
|
|
625
|
+
function warnOmittedObjectRemoteType(remoteKey) {
|
|
626
|
+
mfWarn(`Remote "${remoteKey}" omits type and defaults to 'var'. Set type: 'module' for Vite ESM remotes, or type: 'var' explicitly to silence this warning.`);
|
|
627
|
+
}
|
|
620
628
|
function normalizeRemoteItem(key, remote) {
|
|
621
629
|
warnOnReservedInternalNamePrefix(key, "remoteAlias");
|
|
622
630
|
if (typeof remote === "string") {
|
|
@@ -639,6 +647,8 @@ function normalizeRemoteItem(key, remote) {
|
|
|
639
647
|
shareScope: "default"
|
|
640
648
|
};
|
|
641
649
|
}
|
|
650
|
+
const typeOmitted = remote.type === void 0 || remote.type === null || remote.type === "";
|
|
651
|
+
if (typeOmitted) warnOmittedObjectRemoteType(key);
|
|
642
652
|
return Object.assign({
|
|
643
653
|
type: "var",
|
|
644
654
|
name: key,
|
|
@@ -647,6 +657,7 @@ function normalizeRemoteItem(key, remote) {
|
|
|
647
657
|
entryGlobalName: key
|
|
648
658
|
}, {
|
|
649
659
|
...remote,
|
|
660
|
+
type: typeOmitted ? "var" : remote.type,
|
|
650
661
|
internalName: toInternalModuleFederationName(remote.name || key)
|
|
651
662
|
});
|
|
652
663
|
}
|
|
@@ -664,6 +675,11 @@ function inferVersionFromRequiredVersion(requiredVersion) {
|
|
|
664
675
|
if (typeof requiredVersion !== "string") return void 0;
|
|
665
676
|
return requiredVersion.match(/\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?/)?.[0];
|
|
666
677
|
}
|
|
678
|
+
/** URI-style package specifiers are not semver ranges for runtime satisfy(). */
|
|
679
|
+
const PACKAGE_SPECIFIER_PROTOCOL_RE = /^[a-z][a-z\d+.-]*:/i;
|
|
680
|
+
function isProtocolRequiredVersion(requiredVersion) {
|
|
681
|
+
return PACKAGE_SPECIFIER_PROTOCOL_RE.test(requiredVersion.trim());
|
|
682
|
+
}
|
|
667
683
|
function getLitExportSubpathShares(sharedName) {
|
|
668
684
|
if (sharedName !== "lit") return [];
|
|
669
685
|
const exportsField = getInstalledPackageJson(sharedName, { packageName: sharedName })?.packageJson.exports;
|
|
@@ -691,6 +707,8 @@ function normalizeShareItem(key, shareItem) {
|
|
|
691
707
|
requiredVersion: version ? `^${version}` : "*"
|
|
692
708
|
}
|
|
693
709
|
};
|
|
710
|
+
const userRequiredVersion = shareItem.requiredVersion;
|
|
711
|
+
const keepUserRequiredVersion = userRequiredVersion === false || typeof userRequiredVersion === "string" && userRequiredVersion.trim() !== "" && !isProtocolRequiredVersion(userRequiredVersion);
|
|
694
712
|
return {
|
|
695
713
|
name: key,
|
|
696
714
|
from: "",
|
|
@@ -700,7 +718,7 @@ function normalizeShareItem(key, shareItem) {
|
|
|
700
718
|
import: shareItem.import,
|
|
701
719
|
singleton: shareItem.singleton || false,
|
|
702
720
|
eager: shareItem.eager || false,
|
|
703
|
-
requiredVersion:
|
|
721
|
+
requiredVersion: keepUserRequiredVersion ? userRequiredVersion : isImportFalse || shareItem.version ? "*" : version ? `^${version}` : "*",
|
|
704
722
|
strictVersion: !!shareItem.strictVersion,
|
|
705
723
|
...shareItem.suppressMissingImportWarning ? { suppressMissingImportWarning: true } : {},
|
|
706
724
|
...treeShaking ? { treeShaking: { ...treeShaking } } : {}
|
|
@@ -719,9 +737,9 @@ function normalizeShareItem(key, shareItem) {
|
|
|
719
737
|
* a prefix; concrete subpaths materialize on import via the generic matcher.
|
|
720
738
|
*
|
|
721
739
|
* `react-dom/` must keep collapsing. A browser-wide `react-dom/` prefix would
|
|
722
|
-
* also capture `react-dom/server
|
|
723
|
-
*
|
|
724
|
-
*
|
|
740
|
+
* also capture `react-dom/server*`. Browser-safe entries (`react-dom/client`,
|
|
741
|
+
* `react-dom/profiling`) stay via COMMON_SHARED_SUBPATHS (local provider) or
|
|
742
|
+
* an exact shared key; SSR server* entries need an explicit shared key.
|
|
725
743
|
*/
|
|
726
744
|
function normalizeSharedKey(key) {
|
|
727
745
|
if (!key.endsWith("/")) return key;
|
|
@@ -3432,12 +3450,24 @@ function generateLocalSharedImportMap(options) {
|
|
|
3432
3450
|
}
|
|
3433
3451
|
`;
|
|
3434
3452
|
}
|
|
3453
|
+
/** Expand `pkg/` → package root + matching usedShares; never returns the prefix string. */
|
|
3454
|
+
function expandSharedPrefixKey(prefixKey, used) {
|
|
3455
|
+
const base = prefixKey.slice(0, -1);
|
|
3456
|
+
const expanded = /* @__PURE__ */ new Set([base]);
|
|
3457
|
+
for (const pkg of used) {
|
|
3458
|
+
if (pkg.endsWith("/")) continue;
|
|
3459
|
+
if (pkg === base || pkg.startsWith(`${base}/`)) expanded.add(pkg);
|
|
3460
|
+
}
|
|
3461
|
+
return [...expanded];
|
|
3462
|
+
}
|
|
3435
3463
|
function getOrderedUsedShares(options) {
|
|
3436
3464
|
const resolvedOptions = options ?? getNormalizeModuleFederationOptions();
|
|
3437
|
-
const
|
|
3465
|
+
const used = getUsedShares(options);
|
|
3466
|
+
const shares = new Set(used);
|
|
3438
3467
|
Object.keys(resolvedOptions.shared ?? {}).forEach((pkg) => {
|
|
3439
3468
|
if (!pkg.endsWith("/")) shares.add(pkg);
|
|
3440
3469
|
});
|
|
3470
|
+
for (const [pkg, share] of Object.entries(resolvedOptions.shared ?? {})) if (pkg.endsWith("/") && share.shareConfig?.eager) for (const concrete of expandSharedPrefixKey(pkg, used)) shares.add(concrete);
|
|
3441
3471
|
return orderSharedDependenciesFirst(Array.from(shares).sort((a, b) => {
|
|
3442
3472
|
const priority = (pkg) => pkg === "react" ? 0 : pkg === "react-dom" ? 1 : pkg.startsWith("react/") ? 2 : 3;
|
|
3443
3473
|
return priority(a) - priority(b) || a.localeCompare(b);
|
|
@@ -3447,7 +3477,12 @@ function getMaterializedShares(options) {
|
|
|
3447
3477
|
const resolvedOptions = options ?? getNormalizeModuleFederationOptions();
|
|
3448
3478
|
const scopedRegistrations = options ? usedSharesByOptions.get(options) : void 0;
|
|
3449
3479
|
const shares = new Set(options && scopedRegistrations?.size ? materializedSharesByOptions.get(options) ?? [] : usedShares);
|
|
3450
|
-
|
|
3480
|
+
const usedForEager = options ? usedSharesByOptions.get(options) ?? [] : usedShares;
|
|
3481
|
+
for (const [pkg, share] of Object.entries(resolvedOptions.shared ?? {})) {
|
|
3482
|
+
if (!share.shareConfig?.eager) continue;
|
|
3483
|
+
if (pkg.endsWith("/")) for (const concrete of expandSharedPrefixKey(pkg, usedForEager)) shares.add(concrete);
|
|
3484
|
+
else shares.add(pkg);
|
|
3485
|
+
}
|
|
3451
3486
|
const configured = /* @__PURE__ */ new Map();
|
|
3452
3487
|
for (const pkg of getOrderedUsedShares(options)) {
|
|
3453
3488
|
const packageName = getPackageName(pkg);
|
|
@@ -5122,6 +5157,7 @@ const usedRemotesMap = {};
|
|
|
5122
5157
|
const usedRemotesByOptions = /* @__PURE__ */ new WeakMap();
|
|
5123
5158
|
const dynamicRemotesByOptions = /* @__PURE__ */ new WeakMap();
|
|
5124
5159
|
const staticRemotesByOptions = /* @__PURE__ */ new WeakMap();
|
|
5160
|
+
const preloadRemotesByOptions = /* @__PURE__ */ new WeakMap();
|
|
5125
5161
|
const EMPTY_STATIC_REMOTES = /* @__PURE__ */ new Set();
|
|
5126
5162
|
function getScopedUsedRemotesMap(options) {
|
|
5127
5163
|
let scoped = usedRemotesByOptions.get(options);
|
|
@@ -5159,8 +5195,16 @@ function markStaticRemote(remote, options) {
|
|
|
5159
5195
|
}
|
|
5160
5196
|
remotes.add(remote);
|
|
5161
5197
|
}
|
|
5162
|
-
function
|
|
5163
|
-
|
|
5198
|
+
function markPreloadRemote(remote, options) {
|
|
5199
|
+
let remotes = preloadRemotesByOptions.get(options);
|
|
5200
|
+
if (!remotes) {
|
|
5201
|
+
remotes = /* @__PURE__ */ new Set();
|
|
5202
|
+
preloadRemotesByOptions.set(options, remotes);
|
|
5203
|
+
}
|
|
5204
|
+
remotes.add(remote);
|
|
5205
|
+
}
|
|
5206
|
+
function getPreloadRemotes(options) {
|
|
5207
|
+
return preloadRemotesByOptions.get(options) ?? EMPTY_STATIC_REMOTES;
|
|
5164
5208
|
}
|
|
5165
5209
|
function isDynamicOnlyRemote(remote, options) {
|
|
5166
5210
|
return (dynamicRemotesByOptions.get(options)?.has(remote) ?? false) && !(staticRemotesByOptions.get(options)?.has(remote) ?? false);
|
|
@@ -5660,7 +5704,7 @@ const __mfCurrentScript = document.currentScript;
|
|
|
5660
5704
|
const normalizedOptions = federationOptions ?? getNormalizeModuleFederationOptions();
|
|
5661
5705
|
const isLoadedFirstClientBuild = (_command === "build" || viteConfig?.command === "build") && waitsForInit && !viteConfig?.build?.ssr && normalizedOptions.shareStrategy === "loaded-first";
|
|
5662
5706
|
if (normalizedOptions.shareStrategy === "loaded-first" && !isLoadedFirstClientBuild) return [];
|
|
5663
|
-
const remoteSources = isLoadedFirstClientBuild ? Array.from(
|
|
5707
|
+
const remoteSources = isLoadedFirstClientBuild ? Array.from(getPreloadRemotes(normalizedOptions)) : Object.entries(getUsedRemotesMap(federationOptions)).flatMap(([, remotes]) => Array.from(remotes)).filter((remote) => !federationOptions || !isDynamicOnlyRemote(remote, federationOptions));
|
|
5664
5708
|
return Array.from(new Set(remoteSources.flatMap((remote) => {
|
|
5665
5709
|
const registration = getRemoteRegistration(remote, normalizedOptions.remotes, federationOptions);
|
|
5666
5710
|
return registration && (registration.type === "module" || registration.type === "esm") && /^(?:https?:)?\/\//.test(registration.entry) ? [registration.entry] : [];
|
|
@@ -5680,7 +5724,7 @@ const __mfCurrentScript = document.currentScript;
|
|
|
5680
5724
|
const normalizedOptions = federationOptions ?? getNormalizeModuleFederationOptions();
|
|
5681
5725
|
const isLoadedFirstClientBuild = (_command === "build" || viteConfig?.command === "build") && waitsForInit && !viteConfig?.build?.ssr && normalizedOptions.shareStrategy === "loaded-first";
|
|
5682
5726
|
const shouldPreloadRemotes = !options?.skipRemotePreload && (normalizedOptions.shareStrategy !== "loaded-first" || isLoadedFirstClientBuild);
|
|
5683
|
-
const remoteSources = isLoadedFirstClientBuild ? Array.from(
|
|
5727
|
+
const remoteSources = isLoadedFirstClientBuild ? Array.from(getPreloadRemotes(normalizedOptions)) : Object.entries(getUsedRemotesMap(federationOptions)).flatMap(([, remotes]) => Array.from(remotes)).filter((remote) => !federationOptions || !isDynamicOnlyRemote(remote, federationOptions));
|
|
5684
5728
|
const remotePreloads = shouldPreloadRemotes ? remoteSources.sort().map((remote) => {
|
|
5685
5729
|
const registration = isLoadedFirstClientBuild ? getRemoteRegistration(remote, normalizedOptions.remotes, federationOptions) : void 0;
|
|
5686
5730
|
return `__mfPreloadRemote(${JSON.stringify(getRuntimeRemoteId(remote, normalizedOptions.remotes, federationOptions))}, ${JSON.stringify(remote)}${registration ? `, ${JSON.stringify(registration)}` : ""})`;
|
|
@@ -7028,8 +7072,30 @@ function getRemoteEntrySSRId(options) {
|
|
|
7028
7072
|
return `${REMOTE_ENTRY_SSR_ID}:${getVirtualModuleScopeKey(options)}`;
|
|
7029
7073
|
}
|
|
7030
7074
|
function getSsrRemoteEntryFileName(browserFilename) {
|
|
7031
|
-
|
|
7032
|
-
|
|
7075
|
+
let filename = browserFilename;
|
|
7076
|
+
if (filename.includes("[hash")) {
|
|
7077
|
+
filename = filename.replace(/(?:[._-]?\[hash(?::\d+)?\])/g, "");
|
|
7078
|
+
if (!/\.[^.]+$/.test(filename)) filename = `${filename}.js`;
|
|
7079
|
+
}
|
|
7080
|
+
const ext = filename.match(/\.[^.]+$/)?.[0] || ".js";
|
|
7081
|
+
return `${filename.slice(0, filename.length - ext.length)}.ssr${ext}`;
|
|
7082
|
+
}
|
|
7083
|
+
/** Singleton map for SSR loadShare: expand `pkg/` via usedShares; never serialize the prefix. */
|
|
7084
|
+
function getSsrSharedSingletons(options) {
|
|
7085
|
+
const used = getUsedShares(options);
|
|
7086
|
+
const result = {};
|
|
7087
|
+
for (const [pkg, share] of Object.entries(options.shared)) {
|
|
7088
|
+
if (!share.shareConfig.singleton) continue;
|
|
7089
|
+
if (pkg.endsWith("/")) {
|
|
7090
|
+
for (const concrete of expandSharedPrefixKey(pkg, used)) result[concrete] = {
|
|
7091
|
+
...share,
|
|
7092
|
+
name: concrete
|
|
7093
|
+
};
|
|
7094
|
+
continue;
|
|
7095
|
+
}
|
|
7096
|
+
result[pkg] = share;
|
|
7097
|
+
}
|
|
7098
|
+
return result;
|
|
7033
7099
|
}
|
|
7034
7100
|
/**
|
|
7035
7101
|
* Generates the SSR remote entry module.
|
|
@@ -7043,7 +7109,7 @@ function getSsrRemoteEntryFileName(browserFilename) {
|
|
|
7043
7109
|
*/
|
|
7044
7110
|
function generateRemoteEntrySSR(options) {
|
|
7045
7111
|
const virtualExposesSSRId = getVirtualExposesSSRId(options);
|
|
7046
|
-
const sharedSingletons =
|
|
7112
|
+
const sharedSingletons = getSsrSharedSingletons(options);
|
|
7047
7113
|
return `
|
|
7048
7114
|
import { init as runtimeInit } from "@module-federation/runtime";
|
|
7049
7115
|
|
|
@@ -7398,7 +7464,7 @@ const Manifest = (providedOptions) => {
|
|
|
7398
7464
|
if (this.environment?.name === "ssr") return;
|
|
7399
7465
|
let filesMap = {};
|
|
7400
7466
|
const foundRemoteEntryFile = findRemoteEntryFile(mfOptions.filename, bundle);
|
|
7401
|
-
const expectedSsrRemoteEntryFile = getSsrRemoteEntryFileName(
|
|
7467
|
+
const expectedSsrRemoteEntryFile = getSsrRemoteEntryFileName(mfOptions.filename);
|
|
7402
7468
|
const foundSsrRemoteEntryFile = Object.values(bundle).find((file) => file.fileName === expectedSsrRemoteEntryFile)?.fileName;
|
|
7403
7469
|
if (foundRemoteEntryFile) remoteEntryFile = foundRemoteEntryFile;
|
|
7404
7470
|
ssrRemoteEntryFile = foundSsrRemoteEntryFile || (_command === "serve" ? getSsrRemoteEntryFileName(resolveDevRemoteEntryFileName(mfOptions.filename)) : expectedSsrRemoteEntryFile);
|
|
@@ -9570,6 +9636,7 @@ function registerEntryImports(options, projectRoot, recordShared = true, entryFi
|
|
|
9570
9636
|
if (remoteKey) {
|
|
9571
9637
|
addUsedRemote(remoteKey, request, options);
|
|
9572
9638
|
markStaticRemote(request, options);
|
|
9639
|
+
markPreloadRemote(request, options);
|
|
9573
9640
|
} else if (sharedKey && recordShared) addUsedShares(request, options);
|
|
9574
9641
|
else if (request && !typeOnly) enqueue(request, file, preloadRemotes && isStatic);
|
|
9575
9642
|
}
|
|
@@ -9743,7 +9810,11 @@ export default __mfShared.default ?? __mfShared;`
|
|
|
9743
9810
|
else optimizeDeps.include.push(key);
|
|
9744
9811
|
for (const subpath of getCommonSharedSubpaths(key)) {
|
|
9745
9812
|
const canResolveSubpath = canResolveSharedSubpath(subpath, root);
|
|
9746
|
-
if ([
|
|
9813
|
+
if ([
|
|
9814
|
+
"react/compiler-runtime",
|
|
9815
|
+
"react-dom/client",
|
|
9816
|
+
"react-dom/profiling"
|
|
9817
|
+
].includes(subpath) && !canResolveSubpath) {
|
|
9747
9818
|
optimizeDeps.exclude.push(subpath);
|
|
9748
9819
|
continue;
|
|
9749
9820
|
}
|
|
@@ -5,11 +5,7 @@ const COMMON_SHARED_SUBPATHS = {
|
|
|
5
5
|
"react/jsx-dev-runtime",
|
|
6
6
|
"react/compiler-runtime"
|
|
7
7
|
],
|
|
8
|
-
"react-dom": [
|
|
9
|
-
"react-dom/client",
|
|
10
|
-
"react-dom/server",
|
|
11
|
-
"react-dom/server.browser"
|
|
12
|
-
],
|
|
8
|
+
"react-dom": ["react-dom/client", "react-dom/profiling"],
|
|
13
9
|
"solid-js": [
|
|
14
10
|
"solid-js/web",
|
|
15
11
|
"solid-js/store",
|
|
@@ -606,7 +606,7 @@ async function importTempModule(filePath, versionKey) {
|
|
|
606
606
|
}
|
|
607
607
|
let warnedVmUnavailable = false;
|
|
608
608
|
async function tryVmStrategy(ssrEntry, options) {
|
|
609
|
-
const { loadViaVmStrategy, isVmStrategyAvailable } = await import("./ssrVmStrategy-
|
|
609
|
+
const { loadViaVmStrategy, isVmStrategyAvailable } = await import("./ssrVmStrategy-tpI6we9Q.js");
|
|
610
610
|
if (!await isVmStrategyAvailable()) {
|
|
611
611
|
if (!warnedVmUnavailable) {
|
|
612
612
|
warnedVmUnavailable = true;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as getCommonSharedSubpaths } from "./pathNormalization-
|
|
2
|
-
import { c as readResponseTextBounded, n as neutralizeBrowserPreloadHelpers, s as fetchWithTimeout, t as SsrEntryHttpError } from "./ssrEntryLoader-
|
|
1
|
+
import { a as getCommonSharedSubpaths } from "./pathNormalization-CHct3UwV.js";
|
|
2
|
+
import { c as readResponseTextBounded, n as neutralizeBrowserPreloadHelpers, s as fetchWithTimeout, t as SsrEntryHttpError } from "./ssrEntryLoader-BMtjS_Vl.js";
|
|
3
3
|
//#region src/utils/ssrVmStrategy.ts
|
|
4
4
|
/**
|
|
5
5
|
* vm.SourceTextModule strategy for loading remote SSR entries.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as ssrEntryLoaderPlugin, n as neutralizeBrowserPreloadHelpers, r as revalidate, t as SsrEntryHttpError } from "../ssrEntryLoader-
|
|
1
|
+
import { i as ssrEntryLoaderPlugin, n as neutralizeBrowserPreloadHelpers, r as revalidate, t as SsrEntryHttpError } from "../ssrEntryLoader-BMtjS_Vl.js";
|
|
2
2
|
export { SsrEntryHttpError, ssrEntryLoaderPlugin as default, neutralizeBrowserPreloadHelpers, revalidate };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/vite",
|
|
3
|
-
"version": "1.21.
|
|
3
|
+
"version": "1.21.2",
|
|
4
4
|
"description": "Vite plugin for Module Federation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -93,4 +93,4 @@
|
|
|
93
93
|
"vite": "8.2.0",
|
|
94
94
|
"vitest": "4.1.10"
|
|
95
95
|
}
|
|
96
|
-
}
|
|
96
|
+
}
|