@module-federation/vite 1.20.0 → 1.20.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/lib/index.d.ts +4 -3
- package/lib/index.js +1459 -179
- package/lib/{ssrEntryLoader-BUD1-3Z2.js → ssrEntryLoader-gVPDPAE8.js} +8 -3
- package/lib/{ssrVmStrategy-C_cJtu5V.js → ssrVmStrategy-B34y11HE.js} +1 -1
- package/lib/utils/ssrEntryLoader.d.ts +1 -4
- package/lib/utils/ssrEntryLoader.js +1 -1
- package/package.json +47 -13
- package/lib/pluginDts-Dbbi4cnh.js +0 -845
|
@@ -140,12 +140,13 @@ const runnerCache = /* @__PURE__ */ new Map();
|
|
|
140
140
|
* exist.
|
|
141
141
|
*/
|
|
142
142
|
async function getModuleRunnerModule() {
|
|
143
|
+
const moduleRunnerId = ["vite", "module-runner"].join("/");
|
|
143
144
|
try {
|
|
144
145
|
const { createRequire } = await nodeImport("module");
|
|
145
|
-
return createRequire(import.meta.url)(
|
|
146
|
+
return createRequire(import.meta.url)(moduleRunnerId);
|
|
146
147
|
} catch {}
|
|
147
148
|
try {
|
|
148
|
-
return await
|
|
149
|
+
return await nodeImport(moduleRunnerId);
|
|
149
150
|
} catch {
|
|
150
151
|
return null;
|
|
151
152
|
}
|
|
@@ -216,6 +217,10 @@ function makeUrlCacheKey(url, fetchTimeoutMs, fetchMaxBytes) {
|
|
|
216
217
|
return `${fetchTimeoutMs}::${fetchMaxBytes}::${url}`;
|
|
217
218
|
}
|
|
218
219
|
var SsrEntryHttpError = class extends Error {
|
|
220
|
+
url;
|
|
221
|
+
status;
|
|
222
|
+
statusText;
|
|
223
|
+
bodyPreview;
|
|
219
224
|
constructor(url, status, statusText, bodyPreview) {
|
|
220
225
|
super(`Failed to fetch SSR module "${url}": ${status} ${statusText}` + (bodyPreview ? `\npreview: ${bodyPreview}` : ""));
|
|
221
226
|
this.url = url;
|
|
@@ -568,7 +573,7 @@ async function importTempModule(filePath, versionKey) {
|
|
|
568
573
|
}
|
|
569
574
|
let warnedVmUnavailable = false;
|
|
570
575
|
async function tryVmStrategy(ssrEntry, options) {
|
|
571
|
-
const { loadViaVmStrategy, isVmStrategyAvailable } = await import("./ssrVmStrategy-
|
|
576
|
+
const { loadViaVmStrategy, isVmStrategyAvailable } = await import("./ssrVmStrategy-B34y11HE.js");
|
|
572
577
|
if (!await isVmStrategyAvailable()) {
|
|
573
578
|
if (!warnedVmUnavailable) {
|
|
574
579
|
warnedVmUnavailable = true;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as readResponseTextBounded, n as neutralizeBrowserPreloadHelpers, s as fetchWithTimeout, t as SsrEntryHttpError } from "./ssrEntryLoader-
|
|
1
|
+
import { c as readResponseTextBounded, n as neutralizeBrowserPreloadHelpers, s as fetchWithTimeout, t as SsrEntryHttpError } from "./ssrEntryLoader-gVPDPAE8.js";
|
|
2
2
|
//#region src/utils/ssrVmStrategy.ts
|
|
3
3
|
/**
|
|
4
4
|
* vm.SourceTextModule strategy for loading remote SSR entries.
|
|
@@ -113,10 +113,7 @@ interface SsrEntryLoaderOptions {
|
|
|
113
113
|
}
|
|
114
114
|
declare function ssrEntryLoaderPlugin(options?: SsrEntryLoaderOptions): {
|
|
115
115
|
name: string;
|
|
116
|
-
loadEntry({
|
|
117
|
-
remoteInfo,
|
|
118
|
-
origin
|
|
119
|
-
}: {
|
|
116
|
+
loadEntry({ remoteInfo, origin }: {
|
|
120
117
|
remoteInfo: RemoteInfo;
|
|
121
118
|
origin?: object;
|
|
122
119
|
}): Promise<{
|
|
@@ -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-gVPDPAE8.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.20.
|
|
3
|
+
"version": "1.20.2",
|
|
4
4
|
"description": "Vite plugin for Module Federation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -77,20 +77,54 @@
|
|
|
77
77
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@module-federation/dts-plugin": "2.8.
|
|
81
|
-
"@module-federation/runtime": "2.8.
|
|
82
|
-
"@module-federation/sdk": "2.8.
|
|
80
|
+
"@module-federation/dts-plugin": "2.8.1",
|
|
81
|
+
"@module-federation/runtime": "2.8.1",
|
|
82
|
+
"@module-federation/sdk": "2.8.1"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@playwright/test": "1.
|
|
86
|
-
"@types/node": "
|
|
85
|
+
"@playwright/test": "1.62.0",
|
|
86
|
+
"@types/node": "26.1.2",
|
|
87
87
|
"husky": "9.1.7",
|
|
88
88
|
"mock-shared-dep": "workspace:*",
|
|
89
|
-
"oxfmt": "0.
|
|
90
|
-
"rollup": "4.
|
|
91
|
-
"tsdown": "0.
|
|
92
|
-
"typescript": "
|
|
93
|
-
"vite": "8.
|
|
94
|
-
"vitest": "4.
|
|
89
|
+
"oxfmt": "0.61.0",
|
|
90
|
+
"rollup": "4.62.3",
|
|
91
|
+
"tsdown": "0.22.14",
|
|
92
|
+
"typescript": "7.0.2",
|
|
93
|
+
"vite": "8.2.0",
|
|
94
|
+
"vitest": "4.1.10"
|
|
95
|
+
},
|
|
96
|
+
"pnpm": {
|
|
97
|
+
"overrides": {
|
|
98
|
+
"@babel/core@<7.29.6": "7.29.6",
|
|
99
|
+
"@babel/helpers@<7.26.10": "7.29.7",
|
|
100
|
+
"@babel/plugin-transform-modules-systemjs@<7.29.4": "7.29.4",
|
|
101
|
+
"@babel/runtime@<7.26.10": "7.29.7",
|
|
102
|
+
"adm-zip@<0.6.0": "0.6.0",
|
|
103
|
+
"ajv@>=6.0.0 <6.14.0": "6.14.0",
|
|
104
|
+
"ajv@>=8.0.0 <8.18.0": "8.20.0",
|
|
105
|
+
"body-parser@<1.20.6": "1.20.6",
|
|
106
|
+
"cross-spawn@<7.0.5": "7.0.6",
|
|
107
|
+
"esbuild@<0.28.1": "0.28.1",
|
|
108
|
+
"fast-uri@>=3.0.0 <3.1.4": "3.1.4",
|
|
109
|
+
"follow-redirects@<1.16.0": "1.16.0",
|
|
110
|
+
"http-proxy-middleware@>=2.0.0 <2.0.10": "2.0.10",
|
|
111
|
+
"immutable@<4.3.9": "4.3.9",
|
|
112
|
+
"js-yaml@>=4.0.0 <4.3.0": "4.3.0",
|
|
113
|
+
"lodash@<4.18.0": "4.18.1",
|
|
114
|
+
"path-to-regexp@<0.1.13": "0.1.13",
|
|
115
|
+
"postcss@<8.5.18": "8.5.25",
|
|
116
|
+
"qs@>=6.0.0 <6.15.2": "6.15.2",
|
|
117
|
+
"serialize-javascript@<7.0.5": "7.0.5",
|
|
118
|
+
"shell-quote@<1.9.0": "1.10.0",
|
|
119
|
+
"sucrase@<3.35.1": "3.35.1",
|
|
120
|
+
"undici@>=7.0.0 <7.28.0": "7.28.0",
|
|
121
|
+
"uuid@<11.1.1": "11.1.1",
|
|
122
|
+
"webpack-dev-server@<5.2.6": "5.2.6",
|
|
123
|
+
"webpack@<5.104.1": "5.109.2",
|
|
124
|
+
"websocket-driver@<0.7.5": "0.7.5",
|
|
125
|
+
"ws@>=8.0.0 <8.21.0": "8.21.0",
|
|
126
|
+
"yaml@>=1.0.0 <1.10.3": "1.10.3",
|
|
127
|
+
"yaml@>=2.0.0 <2.8.3": "2.8.3"
|
|
128
|
+
}
|
|
95
129
|
}
|
|
96
|
-
}
|
|
130
|
+
}
|