@module-federation/enhanced 0.0.7 → 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 (171) hide show
  1. package/README.md +164 -6
  2. package/dist/package.json +9 -4
  3. package/dist/src/declarations/plugins/container/AsyncDependenciesBlock.d.ts +57 -0
  4. package/dist/src/declarations/plugins/container/ContainerPlugin.d.ts +187 -0
  5. package/dist/src/declarations/plugins/container/ContainerReferencePlugin.d.ts +80 -0
  6. package/dist/src/declarations/plugins/container/Dependency.d.ts +285 -0
  7. package/dist/src/declarations/plugins/container/Module.d.ts +138 -0
  8. package/dist/src/declarations/plugins/container/ModuleFactory.d.ts +33 -0
  9. package/dist/src/declarations/plugins/container/ModuleFederationPlugin.d.ts +320 -0
  10. package/dist/src/declarations/plugins/container/ObjectDeserializerContext.d.ts +4 -0
  11. package/dist/src/declarations/plugins/container/StaticExportsDependency.d.ts +28 -0
  12. package/dist/src/declarations/plugins/container/Template.d.ts +198 -0
  13. package/dist/src/declarations/plugins/container/WebpackError.d.ts +32 -0
  14. package/dist/src/declarations/plugins/container/WebpackOptions.d.ts +140 -0
  15. package/dist/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.ts +74 -0
  16. package/dist/src/declarations/plugins/sharing/ProvideSharedPlugin.d.ts +67 -0
  17. package/dist/src/declarations/plugins/sharing/SharePlugin.d.ts +78 -0
  18. package/dist/src/index.d.ts +12 -9
  19. package/dist/src/index.js +19 -14
  20. package/dist/src/index.js.map +1 -1
  21. package/dist/src/lib/container/AsyncBoundaryPlugin.d.ts +1 -1
  22. package/dist/src/lib/container/AsyncBoundaryPlugin.js +3 -2
  23. package/dist/src/lib/container/AsyncBoundaryPlugin.js.map +1 -1
  24. package/dist/src/lib/container/ContainerEntryDependency.d.ts +22 -18
  25. package/dist/src/lib/container/ContainerEntryDependency.js +3 -1
  26. package/dist/src/lib/container/ContainerEntryDependency.js.map +1 -1
  27. package/dist/src/lib/container/ContainerEntryModule.d.ts +70 -80
  28. package/dist/src/lib/container/ContainerEntryModule.js +32 -12
  29. package/dist/src/lib/container/ContainerEntryModule.js.map +1 -1
  30. package/dist/src/lib/container/ContainerEntryModuleFactory.d.ts +14 -10
  31. package/dist/src/lib/container/ContainerEntryModuleFactory.js +2 -2
  32. package/dist/src/lib/container/ContainerEntryModuleFactory.js.map +1 -1
  33. package/dist/src/lib/container/ContainerExposedDependency.d.ts +18 -25
  34. package/dist/src/lib/container/ContainerPlugin.d.ts +32 -9
  35. package/dist/src/lib/container/ContainerPlugin.js +110 -10
  36. package/dist/src/lib/container/ContainerPlugin.js.map +1 -1
  37. package/dist/src/lib/container/ContainerReferencePlugin.d.ts +27 -12
  38. package/dist/src/lib/container/ContainerReferencePlugin.js +5 -3
  39. package/dist/src/lib/container/ContainerReferencePlugin.js.map +1 -1
  40. package/dist/src/lib/container/FallbackDependency.d.ts +14 -20
  41. package/dist/src/lib/container/FallbackItemDependency.d.ts +3 -10
  42. package/dist/src/lib/container/FallbackModule.d.ts +52 -70
  43. package/dist/src/lib/container/FallbackModule.js +2 -2
  44. package/dist/src/lib/container/FallbackModule.js.map +1 -1
  45. package/dist/src/lib/container/FallbackModuleFactory.d.ts +10 -10
  46. package/dist/src/lib/container/HoistContainerReferencesPlugin.d.ts +3 -4
  47. package/dist/src/lib/container/HoistContainerReferencesPlugin.js +33 -50
  48. package/dist/src/lib/container/HoistContainerReferencesPlugin.js.map +1 -1
  49. package/dist/src/lib/container/ModuleFederationPlugin.d.ts +21 -14
  50. package/dist/src/lib/container/ModuleFederationPlugin.js +19 -10
  51. package/dist/src/lib/container/ModuleFederationPlugin.js.map +1 -1
  52. package/dist/src/lib/container/ModuleFederationPluginTypes.d.ts +271 -0
  53. package/dist/src/lib/container/ModuleFederationPluginTypes.js +8 -0
  54. package/dist/src/lib/container/ModuleFederationPluginTypes.js.map +1 -0
  55. package/dist/src/lib/container/RemoteModule.d.ts +88 -73
  56. package/dist/src/lib/container/RemoteModule.js +2 -2
  57. package/dist/src/lib/container/RemoteModule.js.map +1 -1
  58. package/dist/src/lib/container/RemoteRuntimeModule.d.ts +10 -7
  59. package/dist/src/lib/container/RemoteRuntimeModule.js +44 -46
  60. package/dist/src/lib/container/RemoteRuntimeModule.js.map +1 -1
  61. package/dist/src/lib/container/RemoteToExternalDependency.d.ts +3 -9
  62. package/dist/src/lib/container/constant.d.ts +3 -0
  63. package/dist/src/lib/container/constant.js +12 -0
  64. package/dist/src/lib/container/constant.js.map +1 -0
  65. package/dist/src/lib/container/options.d.ts +12 -4
  66. package/dist/src/lib/container/runtime/FederationRuntimeModule.d.ts +13 -0
  67. package/dist/src/lib/container/runtime/FederationRuntimeModule.js +27 -0
  68. package/dist/src/lib/container/runtime/FederationRuntimeModule.js.map +1 -0
  69. package/dist/src/lib/container/runtime/FederationRuntimePlugin.d.ts +17 -0
  70. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js +199 -0
  71. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js.map +1 -0
  72. package/dist/src/lib/container/runtime/getFederationGlobal.d.ts +5 -0
  73. package/dist/src/lib/container/runtime/getFederationGlobal.js +24 -0
  74. package/dist/src/lib/container/runtime/getFederationGlobal.js.map +1 -0
  75. package/dist/src/lib/container/runtime/utils.d.ts +15 -0
  76. package/dist/src/lib/container/runtime/utils.js +79 -0
  77. package/dist/src/lib/container/runtime/utils.js.map +1 -0
  78. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +3 -10
  79. package/dist/src/lib/sharing/ConsumeSharedModule.d.ts +97 -104
  80. package/dist/src/lib/sharing/ConsumeSharedModule.js +10 -5
  81. package/dist/src/lib/sharing/ConsumeSharedModule.js.map +1 -1
  82. package/dist/src/lib/sharing/ConsumeSharedPlugin.d.ts +28 -6
  83. package/dist/src/lib/sharing/ConsumeSharedPlugin.js +13 -6
  84. package/dist/src/lib/sharing/ConsumeSharedPlugin.js.map +1 -1
  85. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +29 -11
  86. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js +26 -166
  87. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js.map +1 -1
  88. package/dist/src/lib/sharing/ProvideForSharedDependency.d.ts +3 -11
  89. package/dist/src/lib/sharing/ProvideSharedDependency.d.ts +35 -31
  90. package/dist/src/lib/sharing/ProvideSharedDependency.js +11 -2
  91. package/dist/src/lib/sharing/ProvideSharedDependency.js.map +1 -1
  92. package/dist/src/lib/sharing/ProvideSharedModule.d.ts +65 -77
  93. package/dist/src/lib/sharing/ProvideSharedModule.js +31 -8
  94. package/dist/src/lib/sharing/ProvideSharedModule.js.map +1 -1
  95. package/dist/src/lib/sharing/ProvideSharedModuleFactory.d.ts +17 -10
  96. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js +1 -1
  97. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js.map +1 -1
  98. package/dist/src/lib/sharing/ProvideSharedPlugin.d.ts +37 -24
  99. package/dist/src/lib/sharing/ProvideSharedPlugin.js +12 -2
  100. package/dist/src/lib/sharing/ProvideSharedPlugin.js.map +1 -1
  101. package/dist/src/lib/sharing/SharePlugin.d.ts +39 -13
  102. package/dist/src/lib/sharing/SharePlugin.js +3 -0
  103. package/dist/src/lib/sharing/SharePlugin.js.map +1 -1
  104. package/dist/src/lib/sharing/ShareRuntimeModule.d.ts +12 -7
  105. package/dist/src/lib/sharing/ShareRuntimeModule.js +24 -51
  106. package/dist/src/lib/sharing/ShareRuntimeModule.js.map +1 -1
  107. package/dist/src/lib/sharing/resolveMatchedConfigs.d.ts +12 -8
  108. package/dist/src/lib/sharing/utils.d.ts +21 -17
  109. package/dist/src/lib/sharing/utils.js +17 -2
  110. package/dist/src/lib/sharing/utils.js.map +1 -1
  111. package/dist/src/schemas/container/ContainerPlugin.check.d.ts +7 -0
  112. package/dist/src/schemas/container/ContainerPlugin.check.js +2297 -0
  113. package/dist/src/schemas/container/ContainerPlugin.check.js.map +1 -0
  114. package/dist/src/schemas/container/ContainerPlugin.d.ts +268 -0
  115. package/dist/src/schemas/container/ContainerPlugin.js +306 -0
  116. package/dist/src/schemas/container/ContainerPlugin.js.map +1 -0
  117. package/dist/src/schemas/container/ContainerReferencePlugin.check.d.ts +7 -0
  118. package/dist/src/schemas/container/ContainerReferencePlugin.check.js +939 -0
  119. package/dist/src/schemas/container/ContainerReferencePlugin.check.js.map +1 -0
  120. package/dist/src/schemas/container/ContainerReferencePlugin.d.ts +87 -0
  121. package/dist/src/schemas/container/ContainerReferencePlugin.js +132 -0
  122. package/dist/src/schemas/container/ContainerReferencePlugin.js.map +1 -0
  123. package/dist/src/schemas/container/ModuleFederationPlugin.check.d.ts +9 -7
  124. package/dist/src/schemas/container/ModuleFederationPlugin.check.js +3653 -1341
  125. package/dist/src/schemas/container/ModuleFederationPlugin.check.js.map +1 -1
  126. package/dist/src/schemas/container/ModuleFederationPlugin.d.ts +13 -4
  127. package/dist/src/schemas/container/ModuleFederationPlugin.js +13 -4
  128. package/dist/src/schemas/container/ModuleFederationPlugin.js.map +1 -1
  129. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.d.ts +7 -0
  130. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js +434 -0
  131. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js.map +1 -0
  132. package/dist/src/schemas/sharing/ProviderSharedPlugin.d.ts +104 -0
  133. package/dist/src/schemas/sharing/ProviderSharedPlugin.js +119 -0
  134. package/dist/src/schemas/sharing/ProviderSharedPlugin.js.map +1 -0
  135. package/dist/src/types/runtime.d.ts +7 -0
  136. package/dist/src/types/runtime.js +3 -0
  137. package/dist/src/types/runtime.js.map +1 -0
  138. package/dist/src/wrapper/AsyncBoundaryPlugin.d.ts +8 -0
  139. package/dist/src/wrapper/AsyncBoundaryPlugin.js +19 -0
  140. package/dist/src/wrapper/AsyncBoundaryPlugin.js.map +1 -0
  141. package/dist/src/wrapper/ConsumeSharedPlugin.d.ts +8 -0
  142. package/dist/src/wrapper/ConsumeSharedPlugin.js +19 -0
  143. package/dist/src/wrapper/ConsumeSharedPlugin.js.map +1 -0
  144. package/dist/src/wrapper/ContainerPlugin.d.ts +8 -0
  145. package/dist/src/wrapper/ContainerPlugin.js +19 -0
  146. package/dist/src/wrapper/ContainerPlugin.js.map +1 -0
  147. package/dist/src/wrapper/ContainerReferencePlugin.d.ts +8 -0
  148. package/dist/src/wrapper/ContainerReferencePlugin.js +19 -0
  149. package/dist/src/wrapper/ContainerReferencePlugin.js.map +1 -0
  150. package/dist/src/wrapper/FederationRuntimePlugin.d.ts +9 -0
  151. package/dist/src/wrapper/FederationRuntimePlugin.js +22 -0
  152. package/dist/src/wrapper/FederationRuntimePlugin.js.map +1 -0
  153. package/dist/src/wrapper/HoistContainerReferencesPlugin.d.ts +6 -0
  154. package/dist/src/wrapper/HoistContainerReferencesPlugin.js +18 -0
  155. package/dist/src/wrapper/HoistContainerReferencesPlugin.js.map +1 -0
  156. package/dist/src/wrapper/ModuleFederationPlugin.d.ts +8 -0
  157. package/dist/src/wrapper/ModuleFederationPlugin.js +24 -0
  158. package/dist/src/wrapper/ModuleFederationPlugin.js.map +1 -0
  159. package/dist/src/wrapper/ProvideSharedPlugin.d.ts +8 -0
  160. package/dist/src/wrapper/ProvideSharedPlugin.js +19 -0
  161. package/dist/src/wrapper/ProvideSharedPlugin.js.map +1 -0
  162. package/dist/src/wrapper/SharePlugin.d.ts +8 -0
  163. package/dist/src/wrapper/SharePlugin.js +19 -0
  164. package/dist/src/wrapper/SharePlugin.js.map +1 -0
  165. package/package.json +7 -3
  166. package/dist/src/runtime/ModuleInfoRuntimeModule.d.ts +0 -17
  167. package/dist/src/runtime/ModuleInfoRuntimeModule.js +0 -80
  168. package/dist/src/runtime/ModuleInfoRuntimeModule.js.map +0 -1
  169. package/dist/src/runtime/ModuleInfoRuntimePlugin.d.ts +0 -5
  170. package/dist/src/runtime/ModuleInfoRuntimePlugin.js +0 -24
  171. package/dist/src/runtime/ModuleInfoRuntimePlugin.js.map +0 -1
package/README.md CHANGED
@@ -1,11 +1,169 @@
1
- # enhanced
1
+ # `@module-federation/enhanced`
2
2
 
3
- This library was generated with [Nx](https://nx.dev).
3
+ This package provides enhanced features for module federation.
4
4
 
5
- ## Building
5
+ The following items are exported:
6
6
 
7
- Run `nx build enhanced` to build the library.
7
+ * ModuleFederationPlugin
8
+ * ContainerPlugin
9
+ * ContainerReferencePlugin
10
+ * SharePlugin
11
+ * ConsumeSharedPlugin
12
+ * ProvideSharedPlugin
13
+ * FederationRuntimePlugin
14
+ * AsyncBoundaryPlugin
15
+ * HoistContainerReferencesPlugin
8
16
 
9
- ## Running unit tests
17
+ ## ModuleFederationPlugin
10
18
 
11
- Run `nx test enhanced` to execute the unit tests via [Jest](https://jestjs.io).
19
+ ### Configuration
20
+
21
+ ### name
22
+
23
+ - Type: `string`
24
+ - Required: No
25
+
26
+ The name of the container.
27
+
28
+ ### exposes
29
+
30
+ - Type: `Exposes`
31
+ - Required: No
32
+ - Default: `undefined`
33
+
34
+ Used to specify the modules and file entry points that are exposed via Module Federation. After configuration, the exposed modules will be extracted into a separate chunk, and if there are async chunks, they will also be extracted into a separate chunk (the specific splitting behavior depends on the chunk splitting rules).
35
+
36
+ The `Exposes` type is defined as follows:
37
+
38
+ ```tsx
39
+ type Exposes = (ExposesItem | ExposesObject)[] | ExposesObject;
40
+
41
+ type ExposesItem = string;
42
+
43
+ type ExposesItems = ExposesItem[];
44
+
45
+ interface ExposesObject {
46
+ [exposeKey: string]: ExposesConfig | ExposesItem | ExposesItems;
47
+ }
48
+ ```
49
+
50
+ Here, `exposeKey` is essentially the same as the [Package Entry Points](https://nodejs.org/api/packages.html#package-entry-points) specification (except that regular expression matching is not supported).
51
+
52
+ For example:
53
+
54
+ ```jsx
55
+ module.exports = {
56
+ plugins: [
57
+ new ModuleFederationPlugin({
58
+ name: 'mfButton',
59
+ exposes: {
60
+ // Note: "./" is not supported
61
+ ".": "./src/index.tsx",
62
+ "./add": "./src/utils/add.ts",
63
+ "./Button": "./src/components/Button.tsx",
64
+ }
65
+ }),
66
+ ],
67
+ };
68
+ ```
69
+
70
+ ### remotes
71
+
72
+ > This is a consumer-specific parameter. If remotes is set, it can be considered as a consumer.
73
+
74
+ - Type: `Remotes`
75
+ - Required: No
76
+ - Default: `undefined`
77
+
78
+ This is used to specify how Module Federation consumes remote modules.
79
+
80
+ The `Remotes` type is defined as follows:
81
+
82
+ ```tsx
83
+ type Remotes = (RemotesItem | RemotesObject)[] | RemotesObject;
84
+
85
+ type RemotesItem = string;
86
+ type RemotesItems = RemotesItem[];
87
+
88
+ interface RemotesObject {
89
+ [remoteAlias: string]: RemotesConfig | RemotesItem | RemotesItems;
90
+ }
91
+ ```
92
+
93
+ Here, `remoteAlias` is the name actually used by the user and can be configured arbitrarily. For example, if `remoteAlias` is set to `demo`, the consumption method is `import xx from 'demo'`.
94
+
95
+ ### shared
96
+
97
+ - Type: `Shared`
98
+ - Required: No
99
+ - Default: `undefined`
100
+
101
+
102
+ `shared` is used to share common dependencies between consumers and producers, reducing runtime download size and thus improving performance.
103
+
104
+ The `Shared` type is defined as follows:
105
+
106
+ ```tsx
107
+ type Shared = (SharedItem | SharedObject)[] | SharedObject;
108
+
109
+ type SharedItem = string;
110
+
111
+ interface SharedObject {
112
+ [k: string]: SharedConfig | SharedItem;
113
+ }
114
+ ```
115
+
116
+ #### singleton
117
+
118
+ - Type: `boolean`
119
+ - Required: No
120
+ - Default: `false`
121
+
122
+ Determines whether only one version of the shared module is allowed in the shared scope (singleton mode).
123
+
124
+ - If the value is true, singleton mode is enabled; if the value is false, singleton mode is not enabled.
125
+ - If singleton mode is enabled, the shared dependencies of the remote application components and host application are loaded only once, and a higher version is loaded when the versions are not consistent. At this time, a warning will be given to the lower version side:
126
+ - If singleton mode is not enabled, if the versions of shared dependencies between the remote application and host application are not consistent, the remote application and host application load their own dependencies
127
+
128
+ #### requiredVersion
129
+
130
+ - Type: `string`
131
+ - Required: False
132
+ - Default: `require('project/package.json')[devDeps | dep]['depName']`
133
+
134
+ The required version can be a version range. The default value is the dependency version of the current application.
135
+
136
+ - When using shared dependencies, it will be judged whether the dependency version meets requiredVersion. If it does, it will be used normally. If it is less than requiredVersion, a warning will be issued in the console, and the smallest version in the current shared dependency will be used.
137
+ - When one side sets requiredVersion and the other side sets singleton, the dependency of requiredVersion will be loaded, and the singleton side will directly use the dependency of requiredVersion, regardless of the version.
138
+
139
+ #### eager
140
+ :::warning
141
+ When `eager` is set to true, the shared dependencies will be packaged into the entry file, which will cause the entry file to be too large. Please open with caution.
142
+ `eager: true` is rarely recommended
143
+ :::
144
+
145
+ - Type: `boolean`
146
+ - Required: False
147
+ - Default: `false`
148
+
149
+ Determines whether to load shared modules immediately.
150
+
151
+ Under normal circumstances, you need to open the asynchronous entry, and then load shared asynchronously on demand. If you want to use shared but don't want to enable asynchronous entry, you can set `eager` to true .
152
+
153
+ ### runtimePlugins
154
+
155
+ - Type: `string[]`
156
+ - Required: False
157
+ - Default: `undefined`
158
+
159
+ Used to add additional plug-ins required at runtime. The value is the path of the specific plug-in. It supports absolute/relative paths and package names.
160
+
161
+ Once set, the runtime plugin is automatically injected and used at build time.
162
+
163
+ ### implementation
164
+
165
+ - Type: `string`
166
+ - Required: False
167
+ - Default: `undefined`
168
+
169
+ Used to modify the actual bundler runtime version. Path with value `@module-federation/runtime-tools`.
package/dist/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/enhanced",
3
- "version": "0.0.7",
4
- "type": "commonjs",
3
+ "version": "0.0.9",
5
4
  "main": "./src/index.js",
6
5
  "types": "./dist/src/index.d.ts",
7
6
  "files": [
@@ -17,6 +16,7 @@
17
16
  "exports": {
18
17
  ".": {
19
18
  "require": "./dist/src/index.js",
19
+ "import": "./dist/src/index.js",
20
20
  "types": "./dist/index.d.ts"
21
21
  }
22
22
  },
@@ -27,7 +27,12 @@
27
27
  ]
28
28
  }
29
29
  },
30
+ "devDependencies": {
31
+ "@module-federation/webpack-bundler-runtime": "workspace:*"
32
+ },
30
33
  "dependencies": {
31
- "@module-federation/sdk": "workspace:*"
32
- }
34
+ "@module-federation/sdk": "workspace:*",
35
+ "@module-federation/runtime-tools": "workspace:*"
36
+ },
37
+ "type": "commonjs"
33
38
  }
@@ -0,0 +1,57 @@
1
+ export class AsyncDependenciesBlock extends DependenciesBlock {
2
+ /**
3
+ * @param {(ChunkGroupOptions & { entryOptions?: EntryOptions }) | null} groupOptions options for the group
4
+ * @param {(DependencyLocation | null)=} loc the line of code
5
+ * @param {(string | null)=} request the request
6
+ */
7
+ constructor(
8
+ groupOptions:
9
+ | (ChunkGroupOptions & {
10
+ entryOptions?: EntryOptions;
11
+ })
12
+ | null,
13
+ loc?: (DependencyLocation | null) | undefined,
14
+ request?: (string | null) | undefined,
15
+ );
16
+ groupOptions: import('./ChunkGroup').RawChunkGroupOptions & {
17
+ name?: string | undefined;
18
+ } & {
19
+ entryOptions?: import('./Entrypoint').EntryOptions | undefined;
20
+ };
21
+ loc: import('./Dependency').DependencyLocation | null | undefined;
22
+ request: string | null | undefined;
23
+ _stringifiedGroupOptions: string | undefined;
24
+ /**
25
+ * @param {string | undefined} value The new chunk name
26
+ * @returns {void}
27
+ */
28
+ set chunkName(arg: string | undefined);
29
+ /**
30
+ * @returns {string | undefined} The name of the chunk
31
+ */
32
+ get chunkName(): string | undefined;
33
+ set module(arg: any);
34
+ get module(): any;
35
+ }
36
+ declare namespace AsyncDependenciesBlock {
37
+ export {
38
+ ChunkGraph,
39
+ ChunkGroup,
40
+ ChunkGroupOptions,
41
+ DependencyLocation,
42
+ UpdateHashContext,
43
+ EntryOptions,
44
+ Module,
45
+ ObjectDeserializerContext,
46
+ ObjectSerializerContext,
47
+ Hash,
48
+ };
49
+ }
50
+ import DependenciesBlock = require('./DependenciesBlock');
51
+ type ChunkGroupOptions = import('./ChunkGroup').ChunkGroupOptions;
52
+ type EntryOptions = import('./Entrypoint').EntryOptions;
53
+ type DependencyLocation = import('./Dependency').DependencyLocation;
54
+ type ChunkGraph = import('./ChunkGraph');
55
+ type ChunkGroup = import('./ChunkGroup');
56
+ type UpdateHashContext = import('./Dependency').UpdateHashContext;
57
+ type Hash = import('./util/Hash');
@@ -0,0 +1,187 @@
1
+ /*
2
+ * This file was automatically generated.
3
+ * DO NOT MODIFY BY HAND.
4
+ * Run `yarn special-lint-fix` to update
5
+ */
6
+
7
+ /**
8
+ * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.
9
+ */
10
+ export type Exposes = (ExposesItem | ExposesObject)[] | ExposesObject;
11
+ /**
12
+ * Module that should be exposed by this container.
13
+ */
14
+ export type ExposesItem = string;
15
+ /**
16
+ * Modules that should be exposed by this container.
17
+ */
18
+ export type ExposesItems = ExposesItem[];
19
+ /**
20
+ * Add a container for define/require functions in the AMD module.
21
+ */
22
+ export type AmdContainer = string;
23
+ /**
24
+ * Add a comment in the UMD wrapper.
25
+ */
26
+ export type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
27
+ /**
28
+ * Specify which export should be exposed as library.
29
+ */
30
+ export type LibraryExport = string[] | string;
31
+ /**
32
+ * The name of the library (some types allow unnamed libraries too).
33
+ */
34
+ export type LibraryName = string[] | string | LibraryCustomUmdObject;
35
+ /**
36
+ * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
37
+ */
38
+ export type LibraryType =
39
+ | (
40
+ | 'var'
41
+ | 'module'
42
+ | 'assign'
43
+ | 'assign-properties'
44
+ | 'this'
45
+ | 'window'
46
+ | 'self'
47
+ | 'global'
48
+ | 'commonjs'
49
+ | 'commonjs2'
50
+ | 'commonjs-module'
51
+ | 'commonjs-static'
52
+ | 'amd'
53
+ | 'amd-require'
54
+ | 'umd'
55
+ | 'umd2'
56
+ | 'jsonp'
57
+ | 'system'
58
+ )
59
+ | string;
60
+ /**
61
+ * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
62
+ */
63
+ export type UmdNamedDefine = boolean;
64
+ /**
65
+ * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
66
+ */
67
+ export type EntryRuntime = false | string;
68
+
69
+ export interface ContainerPluginOptions {
70
+ /**
71
+ * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.
72
+ */
73
+ exposes: Exposes;
74
+ /**
75
+ * The filename for this container relative path inside the `output.path` directory.
76
+ */
77
+ filename?: string;
78
+ /**
79
+ * Options for library.
80
+ */
81
+ library?: LibraryOptions;
82
+ /**
83
+ * The name for this container.
84
+ */
85
+ name: string;
86
+ /**
87
+ * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
88
+ */
89
+ runtime?: EntryRuntime;
90
+ /**
91
+ * The name of the share scope which is shared with the host (defaults to 'default').
92
+ */
93
+ shareScope?: string;
94
+ /**
95
+ * Runtime plugin file paths or package name.
96
+ */
97
+ runtimePlugins?: string[];
98
+ }
99
+ /**
100
+ * Modules that should be exposed by this container. Property names are used as public paths.
101
+ */
102
+ export interface ExposesObject {
103
+ /**
104
+ * Modules that should be exposed by this container.
105
+ */
106
+ [k: string]: ExposesConfig | ExposesItem | ExposesItems;
107
+ }
108
+ /**
109
+ * Advanced configuration for modules that should be exposed by this container.
110
+ */
111
+ export interface ExposesConfig {
112
+ /**
113
+ * Request to a module that should be exposed by this container.
114
+ */
115
+ import: ExposesItem | ExposesItems;
116
+ /**
117
+ * Custom chunk name for the exposed module.
118
+ */
119
+ name?: string;
120
+ }
121
+ /**
122
+ * Options for library.
123
+ */
124
+ export interface LibraryOptions {
125
+ /**
126
+ * Add a container for define/require functions in the AMD module.
127
+ */
128
+ amdContainer?: AmdContainer;
129
+ /**
130
+ * Add a comment in the UMD wrapper.
131
+ */
132
+ auxiliaryComment?: AuxiliaryComment;
133
+ /**
134
+ * Specify which export should be exposed as library.
135
+ */
136
+ export?: LibraryExport;
137
+ /**
138
+ * The name of the library (some types allow unnamed libraries too).
139
+ */
140
+ name?: LibraryName;
141
+ /**
142
+ * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
143
+ */
144
+ type: LibraryType;
145
+ /**
146
+ * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
147
+ */
148
+ umdNamedDefine?: UmdNamedDefine;
149
+ }
150
+ /**
151
+ * Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.
152
+ */
153
+ export interface LibraryCustomUmdCommentObject {
154
+ /**
155
+ * Set comment for `amd` section in UMD.
156
+ */
157
+ amd?: string;
158
+ /**
159
+ * Set comment for `commonjs` (exports) section in UMD.
160
+ */
161
+ commonjs?: string;
162
+ /**
163
+ * Set comment for `commonjs2` (module.exports) section in UMD.
164
+ */
165
+ commonjs2?: string;
166
+ /**
167
+ * Set comment for `root` (global variable) section in UMD.
168
+ */
169
+ root?: string;
170
+ }
171
+ /**
172
+ * Description object for all UMD variants of the library name.
173
+ */
174
+ export interface LibraryCustomUmdObject {
175
+ /**
176
+ * Name of the exposed AMD library in the UMD.
177
+ */
178
+ amd?: string;
179
+ /**
180
+ * Name of the exposed commonjs export in the UMD.
181
+ */
182
+ commonjs?: string;
183
+ /**
184
+ * Name of the property exposed globally by a UMD library.
185
+ */
186
+ root?: string[] | string;
187
+ }
@@ -0,0 +1,80 @@
1
+ /*
2
+ * This file was automatically generated.
3
+ * DO NOT MODIFY BY HAND.
4
+ * Run `yarn special-lint-fix` to update
5
+ */
6
+
7
+ /**
8
+ * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
9
+ */
10
+ export type ExternalsType =
11
+ | 'var'
12
+ | 'module'
13
+ | 'assign'
14
+ | 'this'
15
+ | 'window'
16
+ | 'self'
17
+ | 'global'
18
+ | 'commonjs'
19
+ | 'commonjs2'
20
+ | 'commonjs-module'
21
+ | 'commonjs-static'
22
+ | 'amd'
23
+ | 'amd-require'
24
+ | 'umd'
25
+ | 'umd2'
26
+ | 'jsonp'
27
+ | 'system'
28
+ | 'promise'
29
+ | 'import'
30
+ | 'script'
31
+ | 'node-commonjs';
32
+ /**
33
+ * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.
34
+ */
35
+ export type Remotes = (RemotesItem | RemotesObject)[] | RemotesObject;
36
+ /**
37
+ * Container location from which modules should be resolved and loaded at runtime.
38
+ */
39
+ export type RemotesItem = string;
40
+ /**
41
+ * Container locations from which modules should be resolved and loaded at runtime.
42
+ */
43
+ export type RemotesItems = RemotesItem[];
44
+
45
+ export interface ContainerReferencePluginOptions {
46
+ /**
47
+ * The external type of the remote containers.
48
+ */
49
+ remoteType: ExternalsType;
50
+ /**
51
+ * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.
52
+ */
53
+ remotes: Remotes;
54
+ /**
55
+ * The name of the share scope shared with all remotes (defaults to 'default').
56
+ */
57
+ shareScope?: string;
58
+ }
59
+ /**
60
+ * Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.
61
+ */
62
+ export interface RemotesObject {
63
+ /**
64
+ * Container locations from which modules should be resolved and loaded at runtime.
65
+ */
66
+ [k: string]: RemotesConfig | RemotesItem | RemotesItems;
67
+ }
68
+ /**
69
+ * Advanced configuration for container locations from which modules should be resolved and loaded at runtime.
70
+ */
71
+ export interface RemotesConfig {
72
+ /**
73
+ * Container locations from which modules should be resolved and loaded at runtime.
74
+ */
75
+ external: RemotesItem | RemotesItems;
76
+ /**
77
+ * The name of the share scope shared with this remote.
78
+ */
79
+ shareScope?: string;
80
+ }