@module-federation/vite 1.13.4 → 1.13.6
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 +42 -11
- package/lib/index.cjs +501 -82
- package/lib/index.d.cts +3 -3
- package/lib/index.d.mts +3 -3
- package/lib/index.mjs +501 -82
- package/package.json +10 -7
package/README.md
CHANGED
|
@@ -11,17 +11,20 @@ This plugin makes Module Federation work together with [Vite](https://vitejs.dev
|
|
|
11
11
|
|
|
12
12
|
## Working implementations
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
Examples live in [`gioboa/module-federation-vite-examples`](https://github.com/gioboa/module-federation-vite-examples):
|
|
15
|
+
|
|
16
|
+
| Example | Host | Remote | Framework |
|
|
17
|
+
| ---------------------------------------------------------------------------------------- | --------------- | ----------------- | --------------------------- |
|
|
18
|
+
| [Alpine](https://github.com/gioboa/module-federation-vite-examples/tree/main/alpine) | `alpine-host` | `alpine-remote` | Alpine.js |
|
|
19
|
+
| [Angular](https://github.com/gioboa/module-federation-vite-examples/tree/main/angular) | `angular-host` | `angular-remote` | Angular |
|
|
20
|
+
| [Lit](https://github.com/gioboa/module-federation-vite-examples/tree/main/lit) | `lit-host` | `lit-remote` | Lit |
|
|
21
|
+
| [Nuxt](https://github.com/gioboa/module-federation-vite-examples/tree/main/nuxt) | `nuxt-host` | `nuxt-remote` | Nuxt 4 |
|
|
22
|
+
| [React](https://github.com/gioboa/module-federation-vite-examples/tree/main/react) | `react-host` | `react-remote` | React 19 |
|
|
23
|
+
| [Solid](https://github.com/gioboa/module-federation-vite-examples/tree/main/solid) | `solid-host` | `solid-remote` | Solid |
|
|
24
|
+
| [Svelte](https://github.com/gioboa/module-federation-vite-examples/tree/main/svelte) | `svelte-host` | `svelte-remote` | Svelte 5 |
|
|
25
|
+
| [TanStack](https://github.com/gioboa/module-federation-vite-examples/tree/main/tanstack) | `tanstack-host` | `tanstack-remote` | TanStack Router + React 19 |
|
|
26
|
+
| [Vinext](https://github.com/gioboa/module-federation-vite-examples/tree/main/vinext) | `vinext-host` | `vinext-remote` | Vinext + Next 16 + React 19 |
|
|
27
|
+
| [Vue](https://github.com/gioboa/module-federation-vite-examples/tree/main/vue) | `vue-host` | `vue-remote` | Vue 3 |
|
|
25
28
|
|
|
26
29
|
## Try this crazy example with all these bundlers together
|
|
27
30
|
|
|
@@ -130,6 +133,24 @@ export default defineConfig({
|
|
|
130
133
|
// moduleParseTimeout for large codebases where total build time may
|
|
131
134
|
// exceed the fixed timeout value.
|
|
132
135
|
moduleParseIdleTimeout: 10,
|
|
136
|
+
// Controls whether module federation manifest artifacts are generated.
|
|
137
|
+
// Type: boolean | object
|
|
138
|
+
// - false/undefined: no manifest generated
|
|
139
|
+
// - true: generates mf-manifest.json + mf-stats.json (default names)
|
|
140
|
+
// - object: overrides fileName/filePath and asset analysis behavior
|
|
141
|
+
manifest: {
|
|
142
|
+
// Optional output file name for runtime manifest.
|
|
143
|
+
// Default: "mf-manifest.json"
|
|
144
|
+
fileName: "mf-manifest.json",
|
|
145
|
+
// Optional output directory/path for both artifacts.
|
|
146
|
+
// Example: "dist/" -> dist/mf-manifest.json + dist/mf-stats.json
|
|
147
|
+
filePath: "dist/",
|
|
148
|
+
// If true, skips asset analysis.
|
|
149
|
+
// Effect: shared/exposes are omitted from manifest and assetAnalysis is omitted from stats.
|
|
150
|
+
// It also disables the preload-helper patch used for remotes.
|
|
151
|
+
// In serve for consumer-only apps, this defaults to true unless explicitly set.
|
|
152
|
+
disableAssetsAnalyze: false,
|
|
153
|
+
},
|
|
133
154
|
}),
|
|
134
155
|
],
|
|
135
156
|
server: {
|
|
@@ -168,6 +189,16 @@ const RemoteMFE = defineAsyncComponent( 👈
|
|
|
168
189
|
</template>
|
|
169
190
|
```
|
|
170
191
|
|
|
192
|
+
## ⚠️ `codeSplitting: false` is not supported
|
|
193
|
+
|
|
194
|
+
Do not set `build.rolldownOptions.output.codeSplitting` to `false` with this plugin — it will be **automatically ignored**.
|
|
195
|
+
Module federation requires chunk splitting to isolate shared dependencies and remote entries into separate chunks.
|
|
196
|
+
|
|
197
|
+
## ⚠️ `manualChunks` is not supported
|
|
198
|
+
|
|
199
|
+
Do not use `build.rollupOptions.output.manualChunks` with this plugin — it will be **automatically ignored**.
|
|
200
|
+
Module federation transforms shared dependency imports with top-level `await`, and grouping these transformed modules into a single chunk creates circular async dependencies that cause the application to silently hang.
|
|
201
|
+
|
|
171
202
|
### So far so good 🎉
|
|
172
203
|
|
|
173
204
|
Now you are ready to use Module Federation in Vite!
|