@module-federation/vite 1.23.6 → 1.23.7
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 +6 -0
- package/lib/index.js +706 -553
- package/lib/{ssrEntryLoader-Bh2Tq1cZ.js → ssrEntryLoader-DKpOrW8D.js} +69 -5
- package/lib/{ssrVmStrategy-BCaiSEbA.js → ssrVmStrategy-D1cSKUV-.js} +4 -7
- package/lib/utils/ssrEntryLoader.d.ts +7 -1
- package/lib/utils/ssrEntryLoader.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -253,6 +253,8 @@ export default defineConfig({
|
|
|
253
253
|
|
|
254
254
|
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.
|
|
255
255
|
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.
|
|
256
|
+
|
|
257
|
+
The optional `varFilename` wrapper registers the container on `globalThis[name]` and throws if that name already belongs to another global (e.g. `window`, `self`, `location`), even when its value is `0`, `false`, `""` or `null` (e.g. `length`). Use a distinct name or an ESM remote (`type: "module"`). Loading the wrapper again keeps the existing container.
|
|
256
258
|
You can specify the place the host initialization file is injected with the **hostInitInjectLocation** option, which is described in the example code above.
|
|
257
259
|
The **moduleParseTimeout** option allows you to configure the maximum time to wait for module parsing during the build process.
|
|
258
260
|
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.
|
|
@@ -267,6 +269,10 @@ loading stays lazy, including with `loaded-first`. Apps without remotes receive
|
|
|
267
269
|
SSR host bootstrap. Cold development SSR follows the existing Vite 8+ support gate;
|
|
268
270
|
independent SSR builds are supported on Vite 5–8.
|
|
269
271
|
|
|
272
|
+
A remote the application registers at runtime with `init()` or `registerRemotes()`
|
|
273
|
+
under a configured remote's name or alias replaces that remote for `loadRemote()`
|
|
274
|
+
calls. Static `import "remote/expose"` statements keep using the configured entry.
|
|
275
|
+
|
|
270
276
|
Dependencies externalized by Vite keep Node's own runtime resolution. Their runtime
|
|
271
277
|
imports are not bound to the application's instance by this bootstrap.
|
|
272
278
|
Include runtime-consuming dependencies in Vite's `ssr.noExternal` when they need
|