@module-federation/vite 1.20.6 → 1.20.8

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 CHANGED
@@ -135,6 +135,22 @@ export default defineConfig({
135
135
  In this remote app configuration, we define a remoteEntry.js file that will expose the App component.
136
136
  The shared property ensures that both host and remote applications use the same vue library.
137
137
 
138
+ ### Host-only shared dependencies
139
+
140
+ Use `import: false` when a dependency must be provided by the host and should not be bundled as a local fallback. If it is intentionally not installed locally, the named-export detection warning can be suppressed:
141
+
142
+ ```ts
143
+ shared: {
144
+ "@pos-dashboard/host": {
145
+ singleton: true,
146
+ import: false,
147
+ suppressMissingImportWarning: true,
148
+ },
149
+ },
150
+ ```
151
+
152
+ `suppressMissingImportWarning` defaults to `false`. Enable it only when the host is guaranteed to provide the dependency and local named-export detection is unnecessary.
153
+
138
154
  ## The Host Application configuration
139
155
 
140
156
  file **host/vite.config.ts**
package/lib/index.d.ts CHANGED
@@ -61,6 +61,8 @@ type ModuleFederationOptions = {
61
61
  eager?: boolean;
62
62
  requiredVersion?: moduleFederationPlugin.SharedConfig['requiredVersion'];
63
63
  strictVersion?: boolean;
64
+ /** Suppress the missing local dependency warning for `import: false` shares. */
65
+ suppressMissingImportWarning?: boolean;
64
66
  treeShaking?: TreeShakingConfig;
65
67
  import?: moduleFederationPlugin.SharedConfig['import'];
66
68
  }> | undefined;