@rspack-canary/core 1.7.1-canary-becc2931-20260103070024 → 1.7.1-canary-cf4486a4-20260104102432

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.
@@ -1,6 +1,7 @@
1
1
  import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
2
2
  import { RspackBuiltinPlugin } from '../builtin-plugin/base';
3
3
  import type { Compiler } from '../Compiler';
4
+ import { type ModuleFederationPluginOptions } from './ModuleFederationPlugin';
4
5
  export type RemoteAliasMap = Record<string, {
5
6
  name: string;
6
7
  entry?: string;
@@ -15,7 +16,7 @@ export type ManifestSharedOption = {
15
16
  requiredVersion?: string;
16
17
  singleton?: boolean;
17
18
  };
18
- export type ModuleFederationManifestPluginOptions = {
19
+ type InternalManifestPluginOptions = {
19
20
  name?: string;
20
21
  globalName?: string;
21
22
  filePath?: string;
@@ -25,13 +26,19 @@ export type ModuleFederationManifestPluginOptions = {
25
26
  exposes?: ManifestExposeOption[];
26
27
  shared?: ManifestSharedOption[];
27
28
  };
29
+ export type ModuleFederationManifestPluginOptions = boolean | Pick<InternalManifestPluginOptions, 'disableAssetsAnalyze' | 'filePath' | 'fileName'>;
30
+ export declare function getFileName(manifestOptions: ModuleFederationManifestPluginOptions): {
31
+ statsFileName: string;
32
+ manifestFileName: string;
33
+ };
28
34
  /**
29
35
  * JS-side post-processing plugin: reads mf-manifest.json and mf-stats.json, executes additionalData callback and merges/overwrites manifest.
30
36
  * To avoid cross-NAPI callback complexity, this plugin runs at the afterProcessAssets stage to ensure Rust-side MfManifestPlugin has already output its artifacts.
31
37
  */
32
38
  export declare class ModuleFederationManifestPlugin extends RspackBuiltinPlugin {
33
39
  name: BuiltinPluginName;
34
- private opts;
35
- constructor(opts: ModuleFederationManifestPluginOptions);
40
+ private rawOpts;
41
+ constructor(opts: ModuleFederationPluginOptions);
36
42
  raw(compiler: Compiler): BuiltinPlugin;
37
43
  }
44
+ export {};
@@ -1,17 +1,31 @@
1
1
  import type { Compiler } from '../Compiler';
2
+ import type { ExternalsType } from '../config';
2
3
  import { type ModuleFederationManifestPluginOptions } from './ModuleFederationManifestPlugin';
3
4
  import type { ModuleFederationPluginV1Options } from './ModuleFederationPluginV1';
4
- import { type ModuleFederationRuntimeExperimentsOptions } from './ModuleFederationRuntimePlugin';
5
5
  export interface ModuleFederationPluginOptions extends Omit<ModuleFederationPluginV1Options, 'enhanced'> {
6
6
  runtimePlugins?: RuntimePlugins;
7
7
  implementation?: string;
8
8
  shareStrategy?: 'version-first' | 'loaded-first';
9
- manifest?: boolean | Omit<ModuleFederationManifestPluginOptions, 'remoteAliasMap' | 'globalName' | 'name' | 'exposes' | 'shared'>;
10
- experiments?: ModuleFederationRuntimeExperimentsOptions;
9
+ manifest?: ModuleFederationManifestPluginOptions;
10
+ injectUsedExports?: boolean;
11
+ independentShareDir?: string;
12
+ treeshakeSharedExcludePlugins?: string[];
13
+ treeshakeSharedPlugins?: string[];
11
14
  }
12
15
  export type RuntimePlugins = string[] | [string, Record<string, unknown>][];
13
16
  export declare class ModuleFederationPlugin {
14
17
  private _options;
18
+ private _treeShakeSharedPlugin?;
15
19
  constructor(_options: ModuleFederationPluginOptions);
16
20
  apply(compiler: Compiler): void;
17
21
  }
22
+ interface RemoteInfo {
23
+ alias: string;
24
+ name?: string;
25
+ entry?: string;
26
+ externalType: ExternalsType;
27
+ shareScope: string;
28
+ }
29
+ type RemoteInfos = Record<string, RemoteInfo[]>;
30
+ export declare function getRemoteInfos(options: ModuleFederationPluginOptions): RemoteInfos;
31
+ export {};
@@ -1,10 +1,5 @@
1
- export interface ModuleFederationRuntimeExperimentsOptions {
2
- asyncStartup?: boolean;
3
- }
4
1
  export interface ModuleFederationRuntimeOptions {
5
2
  entryRuntime?: string;
6
- experiments?: ModuleFederationRuntimeExperimentsOptions;
7
- asyncStartup?: boolean;
8
3
  }
9
4
  export declare const ModuleFederationRuntimePlugin: {
10
5
  new (options?: ModuleFederationRuntimeOptions | undefined): {
package/dist/exports.d.ts CHANGED
@@ -125,11 +125,14 @@ export declare const container: {
125
125
  import { ConsumeSharedPlugin } from './sharing/ConsumeSharedPlugin';
126
126
  import { ProvideSharedPlugin } from './sharing/ProvideSharedPlugin';
127
127
  import { SharePlugin } from './sharing/SharePlugin';
128
+ import { TreeShakeSharedPlugin } from './sharing/TreeShakeSharedPlugin';
128
129
  export type { ConsumeSharedPluginOptions, Consumes, ConsumesConfig, ConsumesItem, ConsumesObject, } from './sharing/ConsumeSharedPlugin';
129
130
  export type { ProvideSharedPluginOptions, Provides, ProvidesConfig, ProvidesItem, ProvidesObject, } from './sharing/ProvideSharedPlugin';
130
131
  export type { Shared, SharedConfig, SharedItem, SharedObject, SharePluginOptions, } from './sharing/SharePlugin';
132
+ export type { TreeshakeSharedPluginOptions } from './sharing/TreeShakeSharedPlugin';
131
133
  export declare const sharing: {
132
134
  ProvideSharedPlugin: typeof ProvideSharedPlugin;
135
+ TreeShakeSharedPlugin: typeof TreeShakeSharedPlugin;
133
136
  ConsumeSharedPlugin: typeof ConsumeSharedPlugin;
134
137
  SharePlugin: typeof SharePlugin;
135
138
  };