@module-federation/enhanced 0.0.8 → 0.0.9

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.
Files changed (55) hide show
  1. package/dist/package.json +2 -1
  2. package/dist/src/declarations/plugins/container/AsyncDependenciesBlock.d.ts +57 -0
  3. package/dist/src/declarations/plugins/container/ContainerPlugin.d.ts +187 -0
  4. package/dist/src/declarations/plugins/container/ContainerReferencePlugin.d.ts +80 -0
  5. package/dist/src/declarations/plugins/container/Dependency.d.ts +285 -0
  6. package/dist/src/declarations/plugins/container/Module.d.ts +138 -0
  7. package/dist/src/declarations/plugins/container/ModuleFactory.d.ts +33 -0
  8. package/dist/src/declarations/plugins/container/ModuleFederationPlugin.d.ts +320 -0
  9. package/dist/src/declarations/plugins/container/ObjectDeserializerContext.d.ts +4 -0
  10. package/dist/src/declarations/plugins/container/StaticExportsDependency.d.ts +28 -0
  11. package/dist/src/declarations/plugins/container/Template.d.ts +198 -0
  12. package/dist/src/declarations/plugins/container/WebpackError.d.ts +32 -0
  13. package/dist/src/declarations/plugins/container/WebpackOptions.d.ts +140 -0
  14. package/dist/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.ts +74 -0
  15. package/dist/src/declarations/plugins/sharing/ProvideSharedPlugin.d.ts +67 -0
  16. package/dist/src/declarations/plugins/sharing/SharePlugin.d.ts +78 -0
  17. package/dist/src/lib/container/ContainerEntryDependency.d.ts +22 -20
  18. package/dist/src/lib/container/ContainerEntryModule.d.ts +70 -81
  19. package/dist/src/lib/container/ContainerEntryModuleFactory.d.ts +14 -10
  20. package/dist/src/lib/container/ContainerExposedDependency.d.ts +18 -25
  21. package/dist/src/lib/container/ContainerPlugin.d.ts +31 -10
  22. package/dist/src/lib/container/ContainerReferencePlugin.d.ts +27 -12
  23. package/dist/src/lib/container/FallbackDependency.d.ts +14 -20
  24. package/dist/src/lib/container/FallbackItemDependency.d.ts +3 -10
  25. package/dist/src/lib/container/FallbackModule.d.ts +52 -70
  26. package/dist/src/lib/container/FallbackModuleFactory.d.ts +10 -10
  27. package/dist/src/lib/container/ModuleFederationPlugin.d.ts +22 -15
  28. package/dist/src/lib/container/ModuleFederationPlugin.js +2 -2
  29. package/dist/src/lib/container/ModuleFederationPlugin.js.map +1 -1
  30. package/dist/src/lib/container/ModuleFederationPluginTypes.d.ts +271 -0
  31. package/dist/src/lib/container/ModuleFederationPluginTypes.js +8 -0
  32. package/dist/src/lib/container/ModuleFederationPluginTypes.js.map +1 -0
  33. package/dist/src/lib/container/RemoteModule.d.ts +88 -73
  34. package/dist/src/lib/container/RemoteRuntimeModule.d.ts +10 -7
  35. package/dist/src/lib/container/RemoteToExternalDependency.d.ts +3 -9
  36. package/dist/src/lib/container/options.d.ts +12 -4
  37. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js +11 -2
  38. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js.map +1 -1
  39. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +3 -10
  40. package/dist/src/lib/sharing/ConsumeSharedModule.d.ts +97 -104
  41. package/dist/src/lib/sharing/ConsumeSharedPlugin.d.ts +28 -6
  42. package/dist/src/lib/sharing/ConsumeSharedPlugin.js +1 -1
  43. package/dist/src/lib/sharing/ConsumeSharedPlugin.js.map +1 -1
  44. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +29 -11
  45. package/dist/src/lib/sharing/ProvideForSharedDependency.d.ts +3 -11
  46. package/dist/src/lib/sharing/ProvideSharedDependency.d.ts +35 -37
  47. package/dist/src/lib/sharing/ProvideSharedModule.d.ts +65 -83
  48. package/dist/src/lib/sharing/ProvideSharedModuleFactory.d.ts +17 -10
  49. package/dist/src/lib/sharing/ProvideSharedPlugin.d.ts +37 -19
  50. package/dist/src/lib/sharing/SharePlugin.d.ts +39 -13
  51. package/dist/src/lib/sharing/ShareRuntimeModule.d.ts +12 -7
  52. package/dist/src/lib/sharing/resolveMatchedConfigs.d.ts +12 -8
  53. package/dist/src/lib/sharing/utils.d.ts +21 -29
  54. package/dist/src/schemas/container/ModuleFederationPlugin.check.d.ts +9 -7
  55. package/package.json +5 -4
@@ -1,86 +1,75 @@
1
- import type { Compilation } from 'webpack';
2
- import type { LibIdentOptions, NeedBuildContext, RequestShortener, ObjectDeserializerContext, ObjectSerializerContext, WebpackOptions, InputFileSystem, ResolverWithOptions } from 'webpack/lib/Module';
3
- import type WebpackError from 'webpack/lib/WebpackError';
4
- declare const Module: typeof import("webpack").Module;
1
+ import Module = require('webpack/lib/Module');
5
2
  export type ExposeOptions = {
6
- /**
7
- * requests to exposed modules (last one is exported)
8
- */
9
- import: string[];
10
- /**
11
- * custom chunk name for the exposed module
12
- */
13
- name: string;
3
+ /**
4
+ * requests to exposed modules (last one is exported)
5
+ */
6
+ import: string[];
7
+ /**
8
+ * custom chunk name for the exposed module
9
+ */
10
+ name: string;
14
11
  };
12
+ type ObjectDeserializerContext =
13
+ import('webpack/lib/serialization/ObjectMiddleware').ObjectDeserializerContext;
14
+ type WebpackOptions = any;
15
+ type ChunkGraph = import('webpack/lib/ChunkGraph');
16
+ type ChunkGroup = import('webpack/lib/ChunkGroup');
17
+ type Compilation = import('webpack/lib/Compilation');
18
+ type CodeGenerationContext = import('webpack/lib/Module').CodeGenerationContext;
19
+ type CodeGenerationResult = import('webpack/lib/Module').CodeGenerationResult;
20
+ type LibIdentOptions = import('webpack/lib/Module').LibIdentOptions;
21
+ type NeedBuildContext = import('webpack/lib/Module').NeedBuildContext;
22
+ type RequestShortener = import('webpack/lib/RequestShortener');
23
+ type ResolverWithOptions =
24
+ import('webpack/lib/ResolverFactory').ResolverWithOptions;
25
+ type WebpackError = import('webpack/lib/WebpackError');
26
+ type ObjectSerializerContext =
27
+ import('webpack/lib/serialization/ObjectMiddleware').ObjectSerializerContext;
28
+ type Hash = import('webpack/lib/util/Hash');
29
+ type InputFileSystem = import('webpack/lib/util/fs').InputFileSystem;
30
+ type ContainerEntryDependency = typeof import('./ContainerEntryDependency');
31
+
15
32
  declare class ContainerEntryModule extends Module {
16
- private _name;
17
- private _exposes;
18
- private _shareScope;
19
- private _injectRuntimeEntry;
20
- /**
21
- * @param {string} name container entry name
22
- * @param {[string, ExposeOptions][]} exposes list of exposed modules
23
- * @param {string} shareScope name of the share scope
24
- */
25
- constructor(name: string, exposes: [string, ExposeOptions][], shareScope: string, injectRuntimeEntry: string);
26
- /**
27
- * @param {ObjectDeserializerContext} context context
28
- * @returns {ContainerEntryModule} deserialized container entry module
29
- */
30
- static deserialize(context: ObjectDeserializerContext): ContainerEntryModule;
31
- /**
32
- * @returns {Set<string>} types available (do not mutate)
33
- */
34
- getSourceTypes(): Set<string>;
35
- /**
36
- * @returns {string} a unique identifier of the module
37
- */
38
- identifier(): string;
39
- /**
40
- * @param {RequestShortener} requestShortener the request shortener
41
- * @returns {string} a user readable identifier of the module
42
- */
43
- readableIdentifier(requestShortener: RequestShortener): string;
44
- /**
45
- * @param {LibIdentOptions} options options
46
- * @returns {string | null} an identifier for library inclusion
47
- */
48
- libIdent(options: LibIdentOptions): string | null;
49
- /**
50
- * @param {NeedBuildContext} context context info
51
- * @param {function((WebpackError | null)=, boolean=): void} callback callback function, returns true, if the module needs a rebuild
52
- * @returns {void}
53
- */
54
- needBuild(context: NeedBuildContext, callback: (arg0: (WebpackError | null) | undefined, arg1: boolean | undefined) => void): void;
55
- /**
56
- * @param {WebpackOptions} options webpack options
57
- * @param {Compilation} compilation the compilation
58
- * @param {ResolverWithOptions} resolver the resolver
59
- * @param {InputFileSystem} fs the file system
60
- * @param {function(WebpackError): void} callback callback function
61
- * @returns {void}
62
- */
63
- build(options: WebpackOptions, compilation: Compilation, resolver: ResolverWithOptions, fs: InputFileSystem, callback: (err?: WebpackError) => void): void;
64
- /**
65
- * @param {CodeGenerationContext} context context for code generation
66
- * @returns {CodeGenerationResult} result
67
- */
68
- codeGeneration({ moduleGraph, chunkGraph, runtimeTemplate }: {
69
- moduleGraph: any;
70
- chunkGraph: any;
71
- runtimeTemplate: any;
72
- }): {
73
- sources: Map<any, any>;
74
- runtimeRequirements: Set<"__webpack_exports__" | "__webpack_require__.d" | "__webpack_require__.o">;
75
- };
76
- /**
77
- * @param {string=} type the source type for which the size should be estimated
78
- * @returns {number} the estimated size of the module (must be non-zero)
79
- */
80
- size(type?: string): number;
81
- /**
82
- * @param {ObjectSerializerContext} context context
83
- */
84
- serialize(context: ObjectSerializerContext): void;
33
+ /**
34
+ * @param {ObjectDeserializerContext} context context
35
+ * @returns {ContainerEntryModule} deserialized container entry module
36
+ */
37
+ static deserialize(context: ObjectDeserializerContext): ContainerEntryModule;
38
+ /**
39
+ * @param {string} name container entry name
40
+ * @param {[string, ExposeOptions][]} exposes list of exposed modules
41
+ * @param {string} shareScope name of the share scope
42
+ * @param {string[]} runtimePlugins Runtime plugin file paths or package name.
43
+ */
44
+ constructor(
45
+ name: string,
46
+ exposes: [string, ExposeOptions][],
47
+ shareScope: string,
48
+ );
49
+ _name: string;
50
+ _exposes: [string, ExposeOptions][];
51
+ _shareScope: string;
52
+ runtimePlugins: string[];
53
+ }
54
+ declare namespace ContainerEntryModule {
55
+ export {
56
+ WebpackOptions,
57
+ ChunkGraph,
58
+ ChunkGroup,
59
+ Compilation,
60
+ CodeGenerationContext,
61
+ CodeGenerationResult,
62
+ LibIdentOptions,
63
+ NeedBuildContext,
64
+ RequestShortener,
65
+ ResolverWithOptions,
66
+ WebpackError,
67
+ ObjectDeserializerContext,
68
+ ObjectSerializerContext,
69
+ Hash,
70
+ InputFileSystem,
71
+ ContainerEntryDependency,
72
+ ExposeOptions,
73
+ };
85
74
  }
86
75
  export default ContainerEntryModule;
@@ -1,11 +1,15 @@
1
- declare const ModuleFactory: typeof import("webpack/lib/ModuleFactory");
2
- import type { ModuleFactoryCreateData, ModuleFactoryResult } from 'webpack/lib/ModuleFactory';
3
- export default class ContainerEntryModuleFactory extends ModuleFactory {
4
- /**
5
- * @param {ModuleFactoryCreateData} data data object
6
- * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback
7
- * @returns {void}
8
- */
9
- create(data: ModuleFactoryCreateData, callback: (error: Error | null, result: ModuleFactoryResult) => void): void;
1
+ export = ContainerEntryModuleFactory;
2
+ declare class ContainerEntryModuleFactory extends ModuleFactory {}
3
+ declare namespace ContainerEntryModuleFactory {
4
+ export {
5
+ ModuleFactoryCreateData,
6
+ ModuleFactoryResult,
7
+ ContainerEntryDependency,
8
+ };
10
9
  }
11
- export {};
10
+ import ModuleFactory = require('webpack/lib/ModuleFactory');
11
+ type ModuleFactoryCreateData =
12
+ import('webpack/lib/ModuleFactory').ModuleFactoryCreateData;
13
+ type ModuleFactoryResult =
14
+ import('webpack/lib/ModuleFactory').ModuleFactoryResult;
15
+ type ContainerEntryDependency = import('./ContainerEntryDependency');
@@ -1,26 +1,19 @@
1
- declare const dependencies: typeof import("webpack").dependencies;
2
- import type { ObjectDeserializerContext, ObjectSerializerContext } from 'webpack/lib/dependencies/ModuleDependency';
3
- declare class ContainerExposedDependency extends dependencies.ModuleDependency {
4
- exposedName: string;
5
- request: string;
6
- /**
7
- * @param {string} exposedName public name
8
- * @param {string} request request to module
9
- */
10
- constructor(exposedName: string, request: string);
11
- get type(): string;
12
- get category(): string;
13
- /**
14
- * @returns {string | null} an identifier to merge equal requests
15
- */
16
- getResourceIdentifier(): string | null;
17
- /**
18
- * @param {ObjectSerializerContext} context context
19
- */
20
- serialize(context: ObjectSerializerContext): void;
21
- /**
22
- * @param {ObjectDeserializerContext} context context
23
- */
24
- deserialize(context: ObjectDeserializerContext): void;
1
+ export = ContainerExposedDependency;
2
+ /** @typedef {import("webpack/lib/serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
3
+ /** @typedef {import("webpack/lib/serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
4
+ declare class ContainerExposedDependency extends ModuleDependency {
5
+ /**
6
+ * @param {string} exposedName public name
7
+ * @param {string} request request to module
8
+ */
9
+ constructor(exposedName: string, request: string);
10
+ exposedName: string;
25
11
  }
26
- export default ContainerExposedDependency;
12
+ declare namespace ContainerExposedDependency {
13
+ export { ObjectDeserializerContext, ObjectSerializerContext };
14
+ }
15
+ import ModuleDependency = require('webpack/lib/dependencies/ModuleDependency');
16
+ type ObjectDeserializerContext =
17
+ import('webpack/lib/serialization/ObjectMiddleware').ObjectDeserializerContext;
18
+ type ObjectSerializerContext =
19
+ import('webpack/lib/serialization/ObjectMiddleware').ObjectSerializerContext;
@@ -1,13 +1,34 @@
1
- import type { Compiler } from 'webpack';
2
- import type { ContainerPluginOptions } from '../../declarations/plugins/container/ContainerPlugin';
1
+ export = ContainerPlugin;
3
2
  declare class ContainerPlugin {
4
- _options: ContainerPluginOptions;
3
+ /**
4
+ * @param {ContainerPluginOptions} options options
5
+ */
6
+ constructor(options: ContainerPluginOptions);
7
+ name: string;
8
+ _options: {
5
9
  name: string;
6
- /**
7
- * @param {ContainerPluginOptions} options options
8
- */
9
- constructor(options: ContainerPluginOptions);
10
- static patchChunkSplit(compiler: Compiler, name: string): void;
11
- apply(compiler: Compiler): void;
10
+ shareScope: string;
11
+ library: import('../../declarations/plugins/container/ContainerPlugin').LibraryOptions;
12
+ runtime: import('../../declarations/plugins/container/ContainerPlugin').EntryRuntime;
13
+ filename: string;
14
+ exposes: [
15
+ string,
16
+ {
17
+ import: string[];
18
+ name: any;
19
+ },
20
+ ][];
21
+ };
22
+ /**
23
+ * Apply the plugin
24
+ * @param {Compiler} compiler the compiler instance
25
+ * @returns {void}
26
+ */
27
+ apply(compiler: Compiler): void;
12
28
  }
13
- export default ContainerPlugin;
29
+ declare namespace ContainerPlugin {
30
+ export { ContainerPluginOptions, Compiler };
31
+ }
32
+ type Compiler = import('webpack/lib/Compiler');
33
+ type ContainerPluginOptions =
34
+ import('../../declarations/plugins/container/ContainerPlugin').ContainerPluginOptions;
@@ -1,14 +1,29 @@
1
- import type { Compiler } from 'webpack';
2
- import { ContainerReferencePluginOptions } from '../../declarations/plugins/container/ContainerReferencePlugin';
1
+ export = ContainerReferencePlugin;
3
2
  declare class ContainerReferencePlugin {
4
- private _remoteType;
5
- private _remotes;
6
- constructor(options: ContainerReferencePluginOptions);
7
- /**
8
- * Apply the plugin
9
- * @param {Compiler} compiler the compiler instance
10
- * @returns {void}
11
- */
12
- apply(compiler: Compiler): void;
3
+ /**
4
+ * @param {ContainerReferencePluginOptions} options options
5
+ */
6
+ constructor(options: ContainerReferencePluginOptions);
7
+ _remoteType: import('../../declarations/plugins/container/ContainerReferencePlugin').ExternalsType;
8
+ _remotes: [
9
+ string,
10
+ {
11
+ external: string[];
12
+ shareScope: string;
13
+ },
14
+ ][];
15
+ /**
16
+ * Apply the plugin
17
+ * @param {Compiler} compiler the compiler instance
18
+ * @returns {void}
19
+ */
20
+ apply(compiler: Compiler): void;
13
21
  }
14
- export default ContainerReferencePlugin;
22
+ declare namespace ContainerReferencePlugin {
23
+ export { ContainerReferencePluginOptions, RemotesConfig, Compiler };
24
+ }
25
+ type Compiler = import('webpack/lib/Compiler');
26
+ type ContainerReferencePluginOptions =
27
+ import('../../declarations/plugins/container/ContainerReferencePlugin').ContainerReferencePluginOptions;
28
+ type RemotesConfig =
29
+ import('../../declarations/plugins/container/ContainerReferencePlugin').RemotesConfig;
@@ -1,21 +1,15 @@
1
- import type { ObjectDeserializerContext, ObjectSerializerContext } from 'webpack/lib/Dependency';
2
- declare const Dependency: typeof import("webpack").Dependency;
3
- declare class FallbackDependency extends Dependency {
4
- requests: string[];
5
- /**
6
- * @param {string[]} requests requests
7
- */
8
- constructor(requests: string[]);
9
- /**
10
- * @returns {string | null} an identifier to merge equal requests
11
- */
12
- getResourceIdentifier(): string | null;
13
- get type(): string;
14
- get category(): string;
15
- /**
16
- * @param {ObjectSerializerContext} context context
17
- */
18
- serialize(context: ObjectSerializerContext): void;
19
- static deserialize(context: ObjectDeserializerContext): FallbackDependency;
1
+ export class FallbackDependency extends Dependency {
2
+ /**
3
+ * @param {ObjectDeserializerContext} context context
4
+ * @returns {FallbackDependency} deserialize fallback dependency
5
+ */
6
+ static deserialize(context: ObjectDeserializerContext): FallbackDependency;
7
+ /**
8
+ * @param {string[]} requests requests
9
+ */
10
+ constructor(requests: string[]);
11
+ requests: string[];
12
+ }
13
+ declare namespace FallbackDependency {
14
+ export { ObjectDeserializerContext, ObjectSerializerContext };
20
15
  }
21
- export default FallbackDependency;
@@ -1,10 +1,3 @@
1
- declare const dependencies: typeof import("webpack").dependencies;
2
- declare class FallbackItemDependency extends dependencies.ModuleDependency {
3
- /**
4
- * @param {string} request request
5
- */
6
- constructor(request: string);
7
- get type(): string;
8
- get category(): string;
9
- }
10
- export default FallbackItemDependency;
1
+ export = FallbackItemDependency;
2
+ declare class FallbackItemDependency extends ModuleDependency {}
3
+ import ModuleDependency = require('webpack/lib/dependencies/ModuleDependency');
@@ -1,72 +1,54 @@
1
- import type { ChunkGraph, Chunk } from 'webpack';
2
- import type { RequestShortener, LibIdentOptions, CodeGenerationContext, CodeGenerationResult, NeedBuildContext, WebpackError, ResolverWithOptions, InputFileSystem, Compilation, WebpackOptions, ObjectDeserializerContext, ObjectSerializerContext } from 'webpack/lib/Module';
3
- declare const Module: typeof import("webpack").Module;
1
+ export = FallbackModule;
4
2
  declare class FallbackModule extends Module {
5
- requests: string[];
6
- private _identifier;
7
- /**
8
- * @param {string[]} requests list of requests to choose one
9
- */
10
- constructor(requests: string[]);
11
- /**
12
- * @returns {string} a unique identifier of the module
13
- */
14
- identifier(): string;
15
- /**
16
- * @param {RequestShortener} requestShortener the request shortener
17
- * @returns {string} a user readable identifier of the module
18
- */
19
- readableIdentifier(requestShortener: RequestShortener): string;
20
- /**
21
- * @param {LibIdentOptions} options options
22
- * @returns {string | null} an identifier for library inclusion
23
- */
24
- libIdent(options: LibIdentOptions): string | null;
25
- /**
26
- * @param {Chunk} chunk the chunk which condition should be checked
27
- * @param {Compilation} compilation the compilation
28
- * @returns {boolean} true, if the chunk is ok for the module
29
- */
30
- chunkCondition(chunk: Chunk, { chunkGraph }: {
31
- chunkGraph: ChunkGraph;
32
- }): boolean;
33
- /**
34
- * @param {NeedBuildContext} context context info
35
- * @param {function((WebpackError | null)=, boolean=): void} callback callback function, returns true, if the module needs a rebuild
36
- * @returns {void}
37
- */
38
- needBuild(context: NeedBuildContext, callback: (error: WebpackError | null, result?: boolean) => void): void;
39
- /**
40
- * @param {WebpackOptions} options webpack options
41
- * @param {Compilation} compilation the compilation
42
- * @param {ResolverWithOptions} resolver the resolver
43
- * @param {InputFileSystem} fs the file system
44
- * @param {function(WebpackError=): void} callback callback function
45
- * @returns {void}
46
- */
47
- build(options: WebpackOptions, compilation: Compilation, resolver: ResolverWithOptions, fs: InputFileSystem, callback: (error?: WebpackError) => void): void;
48
- /**
49
- * @param {string=} type the source type for which the size should be estimated
50
- * @returns {number} the estimated size of the module (must be non-zero)
51
- */
52
- size(type?: string): number;
53
- /**
54
- * @returns {Set<string>} types available (do not mutate)
55
- */
56
- getSourceTypes(): Set<string>;
57
- /**
58
- * @param {CodeGenerationContext} context context for code generation
59
- * @returns {CodeGenerationResult} result
60
- */
61
- codeGeneration({ runtimeTemplate, moduleGraph, chunkGraph, }: CodeGenerationContext): CodeGenerationResult;
62
- /**
63
- * @param {ObjectSerializerContext} context context
64
- */
65
- serialize(context: ObjectSerializerContext): void;
66
- /**
67
- * @param {ObjectDeserializerContext} context context
68
- * @returns {FallbackModule} deserialized fallback module
69
- */
70
- static deserialize(context: ObjectDeserializerContext): FallbackModule;
3
+ /**
4
+ * @param {ObjectDeserializerContext} context context
5
+ * @returns {FallbackModule} deserialized fallback module
6
+ */
7
+ static deserialize(context: ObjectDeserializerContext): FallbackModule;
8
+ /**
9
+ * @param {string[]} requests list of requests to choose one
10
+ */
11
+ constructor(requests: string[]);
12
+ requests: string[];
13
+ _identifier: string;
71
14
  }
72
- export default FallbackModule;
15
+ declare namespace FallbackModule {
16
+ export {
17
+ WebpackOptions,
18
+ Chunk,
19
+ ChunkGraph,
20
+ ChunkGroup,
21
+ Compilation,
22
+ CodeGenerationContext,
23
+ CodeGenerationResult,
24
+ LibIdentOptions,
25
+ NeedBuildContext,
26
+ RequestShortener,
27
+ ResolverWithOptions,
28
+ WebpackError,
29
+ ObjectDeserializerContext,
30
+ ObjectSerializerContext,
31
+ Hash,
32
+ InputFileSystem,
33
+ };
34
+ }
35
+ import Module = require('webpack/lib/Module');
36
+ type ObjectDeserializerContext =
37
+ import('webpack/lib/serialization/ObjectMiddleware').ObjectDeserializerContext;
38
+ type WebpackOptions = any;
39
+ type Chunk = import('webpack/lib/Chunk');
40
+ type ChunkGraph = import('webpack/lib/ChunkGraph');
41
+ type ChunkGroup = import('webpack/lib/ChunkGroup');
42
+ type Compilation = import('webpack/lib/Compilation');
43
+ type CodeGenerationContext = import('webpack/lib/Module').CodeGenerationContext;
44
+ type CodeGenerationResult = import('webpack/lib/Module').CodeGenerationResult;
45
+ type LibIdentOptions = import('webpack/lib/Module').LibIdentOptions;
46
+ type NeedBuildContext = import('webpack/lib/Module').NeedBuildContext;
47
+ type RequestShortener = import('webpack/lib/RequestShortener');
48
+ type ResolverWithOptions =
49
+ import('webpack/lib/ResolverFactory').ResolverWithOptions;
50
+ type WebpackError = import('webpack/lib/WebpackError');
51
+ type ObjectSerializerContext =
52
+ import('webpack/lib/serialization/ObjectMiddleware').ObjectSerializerContext;
53
+ type Hash = import('webpack/lib/util/Hash');
54
+ type InputFileSystem = import('webpack/lib/util/fs').InputFileSystem;
@@ -1,11 +1,11 @@
1
- import type { ModuleFactoryCreateData, ModuleFactoryResult } from 'webpack/lib/ModuleFactory';
2
- declare const ModuleFactory: typeof import("webpack/lib/ModuleFactory");
3
- export default class FallbackModuleFactory extends ModuleFactory {
4
- /**
5
- * @param {ModuleFactoryCreateData} data data object
6
- * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback
7
- * @returns {void}
8
- */
9
- create(data: ModuleFactoryCreateData, callback: (error: Error | null, result?: ModuleFactoryResult) => void): void;
1
+ export = FallbackModuleFactory;
2
+ declare class FallbackModuleFactory extends ModuleFactory {}
3
+ declare namespace FallbackModuleFactory {
4
+ export { ModuleFactoryCreateData, ModuleFactoryResult, FallbackDependency };
10
5
  }
11
- export {};
6
+ import ModuleFactory = require('webpack/lib/ModuleFactory');
7
+ type ModuleFactoryCreateData =
8
+ import('webpack/lib/ModuleFactory').ModuleFactoryCreateData;
9
+ type ModuleFactoryResult =
10
+ import('webpack/lib/ModuleFactory').ModuleFactoryResult;
11
+ type FallbackDependency = import('./FallbackDependency');
@@ -1,16 +1,23 @@
1
- import type { Compiler, WebpackPluginInstance } from 'webpack';
2
- import type { ModuleFederationPluginOptions } from './ModuleFederationPluginTypes';
3
- declare class ModuleFederationPlugin implements WebpackPluginInstance {
4
- private _options;
5
- /**
6
- * @param {ModuleFederationPluginOptions} options options
7
- */
8
- constructor(options: ModuleFederationPluginOptions);
9
- /**
10
- * Apply the plugin
11
- * @param {Compiler} compiler the compiler instance
12
- * @returns {void}
13
- */
14
- apply(compiler: Compiler): void;
1
+ export = ModuleFederationPlugin;
2
+ declare class ModuleFederationPlugin {
3
+ /**
4
+ * @param {ModuleFederationPluginOptions} options options
5
+ */
6
+ constructor(options: any);
7
+ name: string;
8
+ _options: any;
9
+ /**
10
+ * Apply the plugin
11
+ * @param {Compiler} compiler the compiler instance
12
+ * @returns {void}
13
+ */
14
+ apply(compiler: Compiler): void;
15
15
  }
16
- export default ModuleFederationPlugin;
16
+ declare namespace ModuleFederationPlugin {
17
+ export { ExternalsType, ModuleFederationPluginOptions, Shared, Compiler };
18
+ }
19
+ type Compiler = import('webpack/lib/Compiler');
20
+ type ExternalsType = any;
21
+ type ModuleFederationPluginOptions =
22
+ import('../../declarations/plugins/container/ModuleFederationPlugin').ModuleFederationPluginOptions;
23
+ type Shared = any;
@@ -8,13 +8,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
8
8
  };
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  const normalize_webpack_path_1 = require("@module-federation/sdk/normalize-webpack-path");
11
- const ExternalsType_check_js_1 = __importDefault(require("webpack/schemas/plugins/container/ExternalsType.check.js"));
12
11
  const SharePlugin_1 = __importDefault(require("../sharing/SharePlugin"));
13
12
  const ContainerPlugin_1 = __importDefault(require("./ContainerPlugin"));
14
13
  const ContainerReferencePlugin_1 = __importDefault(require("./ContainerReferencePlugin"));
15
14
  const ModuleFederationPlugin_check_1 = __importDefault(require("../../schemas/container/ModuleFederationPlugin.check"));
16
15
  const ModuleFederationPlugin_1 = __importDefault(require("../../schemas/container/ModuleFederationPlugin"));
17
16
  const FederationRuntimePlugin_1 = __importDefault(require("./runtime/FederationRuntimePlugin"));
17
+ const isValidExternalsType = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack/schemas/plugins/container/ExternalsType.check.js'));
18
18
  const createSchemaValidation = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack/lib/util/create-schema-validation'));
19
19
  const validate = createSchemaValidation(
20
20
  //eslint-disable-next-line
@@ -41,7 +41,7 @@ class ModuleFederationPlugin {
41
41
  new FederationRuntimePlugin_1.default(options).apply(compiler);
42
42
  const library = options.library || { type: 'var', name: options.name };
43
43
  const remoteType = options.remoteType ||
44
- (options.library && (0, ExternalsType_check_js_1.default)(options.library.type)
44
+ (options.library && isValidExternalsType(options.library.type)
45
45
  ? options.library.type
46
46
  : 'script');
47
47
  const useContainerPlugin = options.exposes &&
@@ -1 +1 @@
1
- {"version":3,"file":"ModuleFederationPlugin.js","sourceRoot":"","sources":["../../../../src/lib/container/ModuleFederationPlugin.ts"],"names":[],"mappings":"AAAA;;;EAGE;AAEF,YAAY,CAAC;;;;;AAGb,0FAAqF;AACrF,sHAA4F;AAE5F,yEAAiD;AACjD,wEAAgD;AAChD,0FAAkE;AAClE,wHAAgF;AAChF,4GAAoE;AACpE,gGAAwE;AAExE,MAAM,sBAAsB,GAAG,OAAO,CACpC,IAAA,6CAAoB,EAAC,2CAA2C,CAAC,CACJ,CAAC;AAChE,MAAM,QAAQ,GAAG,sBAAsB;AACrC,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d,MAAM,EAAE,OAAO,CAAC,MAAM;oBACtB,UAAU,EAAE,OAAO,CAAC,UAAU;iBAC/B,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YACrB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,kBAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"ModuleFederationPlugin.js","sourceRoot":"","sources":["../../../../src/lib/container/ModuleFederationPlugin.ts"],"names":[],"mappings":"AAAA;;;EAGE;AAEF,YAAY,CAAC;;;;;AAGb,0FAAqF;AAErF,yEAAiD;AACjD,wEAAgD;AAChD,0FAAkE;AAClE,wHAAgF;AAChF,4GAAoE;AACpE,gGAAwE;AAExE,MAAM,oBAAoB,GAAG,OAAO,CAClC,IAAA,6CAAoB,EAClB,0DAA0D,CAC3D,CAC2E,CAAC;AAE/E,MAAM,sBAAsB,GAAG,OAAO,CACpC,IAAA,6CAAoB,EAAC,2CAA2C,CAAC,CACJ,CAAC;AAChE,MAAM,QAAQ,GAAG,sBAAsB;AACrC,0BAA0B;AAC1B,sCAAY,EACZ,GAAG,EAAE,CAAC,gCAAM,EACZ;IACE,IAAI,EAAE,0BAA0B;IAChC,YAAY,EAAE,SAAS;CACxB,CACF,CAAC;AAEF,MAAM,sBAAsB;IAE1B;;OAEG;IACH,YAAY,OAAsC;QAChD,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,QAAkB;QACtB,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QACnC,aAAa;QACb,IAAI,iCAAuB,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACrD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;QACv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