Skip to content

Commit

Permalink
feat: implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangHongEn committed Nov 25, 2024
1 parent 7b02a9a commit 0f8c58a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function federation(mfUserOptions: ModuleFederationOptions): Plugin[] {
// TODO: singleton
(config.resolve as any).alias.push({
find: '@module-federation/runtime',
replacement: require.resolve('@module-federation/runtime'),
replacement: options.implementation,
});

config.optimizeDeps?.include?.push('@module-federation/runtime');
Expand Down
6 changes: 3 additions & 3 deletions src/utils/normalizeModuleFederationOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export type ModuleFederationOptions = {
| undefined;
runtimePlugins?: string[];
getPublicPath?: string;
implementation?: any;
implementation?: string;
manifest?: ManifestOptions | boolean;
dev?: boolean | PluginDevOptions;
dts?: boolean | PluginDtsOptions;
Expand All @@ -263,7 +263,7 @@ export interface NormalizedModuleFederationOptions {
shareScope: string;
shared: NormalizedShared;
runtimePlugins: string[];
implementation: any;
implementation: string;
manifest: ManifestOptions | boolean;
dev?: boolean | PluginDevOptions;
dts?: boolean | PluginDtsOptions;
Expand Down Expand Up @@ -338,7 +338,7 @@ export function normalizeModuleFederationOptions(
shareScope: options.shareScope || 'default',
shared: normalizeShared(options.shared),
runtimePlugins: options.runtimePlugins || [],
implementation: options.implementation,
implementation: options.implementation || require.resolve('@module-federation/runtime'),
manifest: normalizeManifest(options.manifest),
dev: options.dev,
dts: options.dts,
Expand Down

0 comments on commit 0f8c58a

Please sign in to comment.