@module-federation/enhanced 0.2.0-canary.4 → 0.2.0

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 (393) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +169 -0
  3. package/dist/package.json +83 -0
  4. package/dist/src/declarations/plugins/container/AsyncDependenciesBlock.d.ts +57 -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/ObjectDeserializerContext.d.ts +4 -0
  9. package/dist/src/declarations/plugins/container/StaticExportsDependency.d.ts +28 -0
  10. package/dist/src/declarations/plugins/container/Template.d.ts +198 -0
  11. package/dist/src/declarations/plugins/container/WebpackError.d.ts +32 -0
  12. package/dist/src/declarations/plugins/container/WebpackOptions.d.ts +140 -0
  13. package/dist/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.ts +74 -0
  14. package/dist/src/declarations/plugins/sharing/ProvideSharedPlugin.d.ts +67 -0
  15. package/dist/src/declarations/plugins/sharing/SharePlugin.d.ts +78 -0
  16. package/dist/src/index.d.ts +14 -0
  17. package/dist/src/index.js +37 -0
  18. package/dist/src/index.js.map +1 -0
  19. package/dist/src/lib/Constants.js +125 -0
  20. package/dist/src/lib/Constants.js.map +1 -0
  21. package/dist/src/lib/RuntimeGlobals.d.ts +0 -0
  22. package/{src → dist/src}/lib/RuntimeGlobals.js +144 -74
  23. package/dist/src/lib/RuntimeGlobals.js.map +1 -0
  24. package/dist/src/lib/container/AsyncBoundaryPlugin.d.ts +20 -0
  25. package/dist/src/lib/container/AsyncBoundaryPlugin.js +198 -0
  26. package/dist/src/lib/container/AsyncBoundaryPlugin.js.map +1 -0
  27. package/dist/src/lib/container/ContainerEntryDependency.d.ts +24 -0
  28. package/dist/src/lib/container/ContainerEntryDependency.js +39 -0
  29. package/dist/src/lib/container/ContainerEntryDependency.js.map +1 -0
  30. package/dist/src/lib/container/ContainerEntryModule.d.ts +75 -0
  31. package/dist/src/lib/container/ContainerEntryModule.js +240 -0
  32. package/dist/src/lib/container/ContainerEntryModule.js.map +1 -0
  33. package/dist/src/lib/container/ContainerEntryModuleFactory.d.ts +15 -0
  34. package/dist/src/lib/container/ContainerEntryModuleFactory.js +30 -0
  35. package/dist/src/lib/container/ContainerEntryModuleFactory.js.map +1 -0
  36. package/dist/src/lib/container/ContainerExposedDependency.d.ts +19 -0
  37. package/dist/src/lib/container/ContainerExposedDependency.js +49 -0
  38. package/dist/src/lib/container/ContainerExposedDependency.js.map +1 -0
  39. package/dist/src/lib/container/ContainerPlugin.d.ts +13 -0
  40. package/dist/src/lib/container/ContainerPlugin.js +188 -0
  41. package/dist/src/lib/container/ContainerPlugin.js.map +1 -0
  42. package/{src → dist/src}/lib/container/ContainerReferencePlugin.d.ts +3 -3
  43. package/dist/src/lib/container/ContainerReferencePlugin.js +102 -0
  44. package/dist/src/lib/container/ContainerReferencePlugin.js.map +1 -0
  45. package/dist/src/lib/container/FallbackDependency.d.ts +15 -0
  46. package/dist/src/lib/container/FallbackDependency.js +47 -0
  47. package/dist/src/lib/container/FallbackDependency.js.map +1 -0
  48. package/dist/src/lib/container/FallbackItemDependency.d.ts +3 -0
  49. package/dist/src/lib/container/FallbackItemDependency.js +26 -0
  50. package/dist/src/lib/container/FallbackItemDependency.js.map +1 -0
  51. package/dist/src/lib/container/FallbackModule.d.ts +54 -0
  52. package/dist/src/lib/container/FallbackModule.js +152 -0
  53. package/dist/src/lib/container/FallbackModule.js.map +1 -0
  54. package/dist/src/lib/container/FallbackModuleFactory.d.ts +11 -0
  55. package/dist/src/lib/container/FallbackModuleFactory.js +28 -0
  56. package/dist/src/lib/container/FallbackModuleFactory.js.map +1 -0
  57. package/dist/src/lib/container/HoistContainerReferencesPlugin.d.ts +14 -0
  58. package/dist/src/lib/container/HoistContainerReferencesPlugin.js +64 -0
  59. package/dist/src/lib/container/HoistContainerReferencesPlugin.js.map +1 -0
  60. package/dist/src/lib/container/ModuleFederationPlugin.d.ts +17 -0
  61. package/dist/src/lib/container/ModuleFederationPlugin.js +128 -0
  62. package/dist/src/lib/container/ModuleFederationPlugin.js.map +1 -0
  63. package/dist/src/lib/container/RemoteModule.d.ts +90 -0
  64. package/dist/src/lib/container/RemoteModule.js +148 -0
  65. package/dist/src/lib/container/RemoteModule.js.map +1 -0
  66. package/dist/src/lib/container/RemoteRuntimeModule.d.ts +12 -0
  67. package/dist/src/lib/container/RemoteRuntimeModule.js +101 -0
  68. package/dist/src/lib/container/RemoteRuntimeModule.js.map +1 -0
  69. package/{src → dist/src}/lib/container/RemoteToExternalDependency.d.ts +3 -9
  70. package/dist/src/lib/container/RemoteToExternalDependency.js +26 -0
  71. package/dist/src/lib/container/RemoteToExternalDependency.js.map +1 -0
  72. package/dist/src/lib/container/constant.d.ts +3 -0
  73. package/dist/src/lib/container/constant.js +12 -0
  74. package/dist/src/lib/container/constant.js.map +1 -0
  75. package/{src → dist/src}/lib/container/options.d.ts +12 -4
  76. package/{src → dist/src}/lib/container/options.js +32 -42
  77. package/dist/src/lib/container/options.js.map +1 -0
  78. package/dist/src/lib/container/runtime/FederationRuntimeModule.d.ts +13 -0
  79. package/dist/src/lib/container/runtime/FederationRuntimeModule.js +49 -0
  80. package/dist/src/lib/container/runtime/FederationRuntimeModule.js.map +1 -0
  81. package/dist/src/lib/container/runtime/FederationRuntimePlugin.d.ts +17 -0
  82. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js +209 -0
  83. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js.map +1 -0
  84. package/dist/src/lib/container/runtime/getFederationGlobal.d.ts +5 -0
  85. package/dist/src/lib/container/runtime/getFederationGlobal.js +26 -0
  86. package/dist/src/lib/container/runtime/getFederationGlobal.js.map +1 -0
  87. package/dist/src/lib/container/runtime/utils.d.ts +16 -0
  88. package/dist/src/lib/container/runtime/utils.js +83 -0
  89. package/dist/src/lib/container/runtime/utils.js.map +1 -0
  90. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +3 -0
  91. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js +26 -0
  92. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js.map +1 -0
  93. package/dist/src/lib/sharing/ConsumeSharedModule.d.ts +99 -0
  94. package/dist/src/lib/sharing/ConsumeSharedModule.js +206 -0
  95. package/dist/src/lib/sharing/ConsumeSharedModule.js.map +1 -0
  96. package/dist/src/lib/sharing/ConsumeSharedPlugin.d.ts +30 -0
  97. package/dist/src/lib/sharing/ConsumeSharedPlugin.js +245 -0
  98. package/dist/src/lib/sharing/ConsumeSharedPlugin.js.map +1 -0
  99. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +31 -0
  100. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js +124 -0
  101. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js.map +1 -0
  102. package/dist/src/lib/sharing/ProvideForSharedDependency.d.ts +3 -0
  103. package/dist/src/lib/sharing/ProvideForSharedDependency.js +27 -0
  104. package/dist/src/lib/sharing/ProvideForSharedDependency.js.map +1 -0
  105. package/dist/src/lib/sharing/ProvideSharedDependency.d.ts +36 -0
  106. package/dist/src/lib/sharing/ProvideSharedDependency.js +70 -0
  107. package/dist/src/lib/sharing/ProvideSharedDependency.js.map +1 -0
  108. package/dist/src/lib/sharing/ProvideSharedModule.d.ts +67 -0
  109. package/dist/src/lib/sharing/ProvideSharedModule.js +186 -0
  110. package/dist/src/lib/sharing/ProvideSharedModule.js.map +1 -0
  111. package/dist/src/lib/sharing/ProvideSharedModuleFactory.d.ts +18 -0
  112. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js +30 -0
  113. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js.map +1 -0
  114. package/dist/src/lib/sharing/ProvideSharedPlugin.d.ts +47 -0
  115. package/dist/src/lib/sharing/ProvideSharedPlugin.js +195 -0
  116. package/dist/src/lib/sharing/ProvideSharedPlugin.js.map +1 -0
  117. package/dist/src/lib/sharing/SharePlugin.d.ts +41 -0
  118. package/dist/src/lib/sharing/SharePlugin.js +79 -0
  119. package/dist/src/lib/sharing/SharePlugin.js.map +1 -0
  120. package/dist/src/lib/sharing/ShareRuntimeModule.d.ts +14 -0
  121. package/dist/src/lib/sharing/ShareRuntimeModule.js +102 -0
  122. package/dist/src/lib/sharing/ShareRuntimeModule.js.map +1 -0
  123. package/dist/src/lib/sharing/resolveMatchedConfigs.d.ts +12 -0
  124. package/dist/src/lib/sharing/resolveMatchedConfigs.js +66 -0
  125. package/dist/src/lib/sharing/resolveMatchedConfigs.js.map +1 -0
  126. package/dist/src/lib/sharing/utils.d.ts +37 -0
  127. package/{src → dist/src}/lib/sharing/utils.js +109 -81
  128. package/dist/src/lib/sharing/utils.js.map +1 -0
  129. package/dist/src/rspack.d.ts +1 -0
  130. package/dist/src/rspack.js +6 -0
  131. package/dist/src/rspack.js.map +1 -0
  132. package/{src → dist/src}/runtime/AddRuntimeRequirementToPromiseExternalPlugin.d.ts +1 -1
  133. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js +19 -0
  134. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js.map +1 -0
  135. package/dist/src/runtime.d.ts +1 -0
  136. package/dist/src/runtime.js +18 -0
  137. package/dist/src/runtime.js.map +1 -0
  138. package/dist/src/schemas/container/ContainerPlugin.check.d.ts +7 -0
  139. package/dist/src/schemas/container/ContainerPlugin.check.js +2318 -0
  140. package/dist/src/schemas/container/ContainerPlugin.check.js.map +1 -0
  141. package/dist/src/schemas/container/ContainerPlugin.d.ts +289 -0
  142. package/dist/src/schemas/container/ContainerPlugin.js +326 -0
  143. package/dist/src/schemas/container/ContainerPlugin.js.map +1 -0
  144. package/dist/src/schemas/container/ContainerReferencePlugin.check.d.ts +7 -0
  145. package/dist/src/schemas/container/ContainerReferencePlugin.check.js +939 -0
  146. package/dist/src/schemas/container/ContainerReferencePlugin.check.js.map +1 -0
  147. package/dist/src/schemas/container/ContainerReferencePlugin.d.ts +87 -0
  148. package/dist/src/schemas/container/ContainerReferencePlugin.js +132 -0
  149. package/dist/src/schemas/container/ContainerReferencePlugin.js.map +1 -0
  150. package/dist/src/schemas/container/ModuleFederationPlugin.check.d.ts +9 -0
  151. package/dist/src/schemas/container/ModuleFederationPlugin.check.js +4001 -0
  152. package/dist/src/schemas/container/ModuleFederationPlugin.check.js.map +1 -0
  153. package/{src → dist/src}/schemas/container/ModuleFederationPlugin.d.ts +197 -4
  154. package/{src → dist/src}/schemas/container/ModuleFederationPlugin.js +349 -177
  155. package/dist/src/schemas/container/ModuleFederationPlugin.js.map +1 -0
  156. package/{src/schemas/container/ModuleFederationPlugin.check.d.ts → dist/src/schemas/sharing/ProviderSharedPlugin.check.d.ts} +2 -2
  157. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js +434 -0
  158. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js.map +1 -0
  159. package/dist/src/schemas/sharing/ProviderSharedPlugin.d.ts +104 -0
  160. package/dist/src/schemas/sharing/ProviderSharedPlugin.js +119 -0
  161. package/dist/src/schemas/sharing/ProviderSharedPlugin.js.map +1 -0
  162. package/dist/src/types/runtime.d.ts +7 -0
  163. package/dist/src/types/runtime.js +3 -0
  164. package/dist/src/types/runtime.js.map +1 -0
  165. package/dist/src/webpack.d.ts +2 -0
  166. package/dist/src/webpack.js +9 -0
  167. package/dist/src/webpack.js.map +1 -0
  168. package/dist/src/wrapper/AsyncBoundaryPlugin.d.ts +8 -0
  169. package/dist/src/wrapper/AsyncBoundaryPlugin.js +19 -0
  170. package/dist/src/wrapper/AsyncBoundaryPlugin.js.map +1 -0
  171. package/dist/src/wrapper/ConsumeSharedPlugin.d.ts +8 -0
  172. package/dist/src/wrapper/ConsumeSharedPlugin.js +19 -0
  173. package/dist/src/wrapper/ConsumeSharedPlugin.js.map +1 -0
  174. package/dist/src/wrapper/ContainerPlugin.d.ts +8 -0
  175. package/dist/src/wrapper/ContainerPlugin.js +19 -0
  176. package/dist/src/wrapper/ContainerPlugin.js.map +1 -0
  177. package/dist/src/wrapper/ContainerReferencePlugin.d.ts +8 -0
  178. package/dist/src/wrapper/ContainerReferencePlugin.js +19 -0
  179. package/dist/src/wrapper/ContainerReferencePlugin.js.map +1 -0
  180. package/dist/src/wrapper/FederationRuntimePlugin.d.ts +9 -0
  181. package/dist/src/wrapper/FederationRuntimePlugin.js +22 -0
  182. package/dist/src/wrapper/FederationRuntimePlugin.js.map +1 -0
  183. package/dist/src/wrapper/HoistContainerReferencesPlugin.d.ts +7 -0
  184. package/dist/src/wrapper/HoistContainerReferencesPlugin.js +19 -0
  185. package/dist/src/wrapper/HoistContainerReferencesPlugin.js.map +1 -0
  186. package/dist/src/wrapper/ModuleFederationPlugin.d.ts +8 -0
  187. package/dist/src/wrapper/ModuleFederationPlugin.js +39 -0
  188. package/dist/src/wrapper/ModuleFederationPlugin.js.map +1 -0
  189. package/dist/src/wrapper/ProvideSharedPlugin.d.ts +8 -0
  190. package/dist/src/wrapper/ProvideSharedPlugin.js +19 -0
  191. package/dist/src/wrapper/ProvideSharedPlugin.js.map +1 -0
  192. package/dist/src/wrapper/SharePlugin.d.ts +8 -0
  193. package/dist/src/wrapper/SharePlugin.js +19 -0
  194. package/dist/src/wrapper/SharePlugin.js.map +1 -0
  195. package/package.json +73 -7
  196. package/global.d.js +0 -14
  197. package/global.d.js.map +0 -1
  198. package/pullts.d.ts +0 -1
  199. package/src/declarations/plugins/container/AsyncDependenciesBlock.d.js +0 -14
  200. package/src/declarations/plugins/container/AsyncDependenciesBlock.d.js.map +0 -1
  201. package/src/declarations/plugins/container/ContainerPlugin.d.js +0 -12
  202. package/src/declarations/plugins/container/ContainerPlugin.d.js.map +0 -1
  203. package/src/declarations/plugins/container/ContainerReferencePlugin.d.js +0 -12
  204. package/src/declarations/plugins/container/ContainerReferencePlugin.d.js.map +0 -1
  205. package/src/declarations/plugins/container/Dependency.d.js +0 -14
  206. package/src/declarations/plugins/container/Dependency.d.js.map +0 -1
  207. package/src/declarations/plugins/container/Module.d.js +0 -3
  208. package/src/declarations/plugins/container/Module.d.js.map +0 -1
  209. package/src/declarations/plugins/container/ModuleFactory.d.js +0 -3
  210. package/src/declarations/plugins/container/ModuleFactory.d.js.map +0 -1
  211. package/src/declarations/plugins/container/ModuleFederationPlugin.d.js +0 -12
  212. package/src/declarations/plugins/container/ModuleFederationPlugin.d.js.map +0 -1
  213. package/src/declarations/plugins/container/ObjectDeserializerContext.d.js +0 -6
  214. package/src/declarations/plugins/container/ObjectDeserializerContext.d.js.map +0 -1
  215. package/src/declarations/plugins/container/StaticExportsDependency.d.js +0 -14
  216. package/src/declarations/plugins/container/StaticExportsDependency.d.js.map +0 -1
  217. package/src/declarations/plugins/container/Template.d.js +0 -4
  218. package/src/declarations/plugins/container/Template.d.js.map +0 -1
  219. package/src/declarations/plugins/container/WebpackError.d.js +0 -3
  220. package/src/declarations/plugins/container/WebpackError.d.js.map +0 -1
  221. package/src/declarations/plugins/container/WebpackOptions.d.js +0 -6
  222. package/src/declarations/plugins/container/WebpackOptions.d.js.map +0 -1
  223. package/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.js +0 -12
  224. package/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.js.map +0 -1
  225. package/src/declarations/plugins/sharing/ProvideSharedPlugin.d.js +0 -12
  226. package/src/declarations/plugins/sharing/ProvideSharedPlugin.d.js.map +0 -1
  227. package/src/declarations/plugins/sharing/SharePlugin.d.js +0 -12
  228. package/src/declarations/plugins/sharing/SharePlugin.d.js.map +0 -1
  229. package/src/index.d.ts +0 -7
  230. package/src/index.js +0 -47
  231. package/src/index.js.map +0 -1
  232. package/src/lib/Constants.js +0 -103
  233. package/src/lib/Constants.js.map +0 -1
  234. package/src/lib/RuntimeGlobals.d.ts +0 -1
  235. package/src/lib/RuntimeGlobals.js.map +0 -1
  236. package/src/lib/container/AsyncBoundaryPlugin.d.ts +0 -16
  237. package/src/lib/container/AsyncBoundaryPlugin.js +0 -141
  238. package/src/lib/container/AsyncBoundaryPlugin.js.map +0 -1
  239. package/src/lib/container/ContainerEntryDependency.d.js +0 -4
  240. package/src/lib/container/ContainerEntryDependency.d.js.map +0 -1
  241. package/src/lib/container/ContainerEntryDependency.d.ts +0 -20
  242. package/src/lib/container/ContainerEntryDependency.js +0 -47
  243. package/src/lib/container/ContainerEntryDependency.js.map +0 -1
  244. package/src/lib/container/ContainerEntryModule.d.js +0 -14
  245. package/src/lib/container/ContainerEntryModule.d.js.map +0 -1
  246. package/src/lib/container/ContainerEntryModule.d.ts +0 -85
  247. package/src/lib/container/ContainerEntryModule.js +0 -281
  248. package/src/lib/container/ContainerEntryModule.js.map +0 -1
  249. package/src/lib/container/ContainerEntryModuleFactory.d.js +0 -4
  250. package/src/lib/container/ContainerEntryModuleFactory.d.js.map +0 -1
  251. package/src/lib/container/ContainerEntryModuleFactory.d.ts +0 -10
  252. package/src/lib/container/ContainerEntryModuleFactory.js +0 -37
  253. package/src/lib/container/ContainerEntryModuleFactory.js.map +0 -1
  254. package/src/lib/container/ContainerExposedDependency.d.js +0 -4
  255. package/src/lib/container/ContainerExposedDependency.d.js.map +0 -1
  256. package/src/lib/container/ContainerExposedDependency.d.ts +0 -26
  257. package/src/lib/container/ContainerExposedDependency.js +0 -57
  258. package/src/lib/container/ContainerExposedDependency.js.map +0 -1
  259. package/src/lib/container/ContainerPlugin.d.js +0 -4
  260. package/src/lib/container/ContainerPlugin.d.js.map +0 -1
  261. package/src/lib/container/ContainerPlugin.d.ts +0 -11
  262. package/src/lib/container/ContainerPlugin.js +0 -92
  263. package/src/lib/container/ContainerPlugin.js.map +0 -1
  264. package/src/lib/container/ContainerReferencePlugin.d.js +0 -4
  265. package/src/lib/container/ContainerReferencePlugin.d.js.map +0 -1
  266. package/src/lib/container/ContainerReferencePlugin.js +0 -141
  267. package/src/lib/container/ContainerReferencePlugin.js.map +0 -1
  268. package/src/lib/container/FallbackDependency.d.js +0 -14
  269. package/src/lib/container/FallbackDependency.d.js.map +0 -1
  270. package/src/lib/container/FallbackDependency.d.ts +0 -25
  271. package/src/lib/container/FallbackDependency.js +0 -59
  272. package/src/lib/container/FallbackDependency.js.map +0 -1
  273. package/src/lib/container/FallbackItemDependency.d.js +0 -4
  274. package/src/lib/container/FallbackItemDependency.d.js.map +0 -1
  275. package/src/lib/container/FallbackItemDependency.d.ts +0 -10
  276. package/src/lib/container/FallbackItemDependency.js +0 -37
  277. package/src/lib/container/FallbackItemDependency.js.map +0 -1
  278. package/src/lib/container/FallbackModule.d.js +0 -4
  279. package/src/lib/container/FallbackModule.d.js.map +0 -1
  280. package/src/lib/container/FallbackModule.d.ts +0 -73
  281. package/src/lib/container/FallbackModule.js +0 -153
  282. package/src/lib/container/FallbackModule.js.map +0 -1
  283. package/src/lib/container/FallbackModuleFactory.d.js +0 -4
  284. package/src/lib/container/FallbackModuleFactory.d.js.map +0 -1
  285. package/src/lib/container/FallbackModuleFactory.d.ts +0 -10
  286. package/src/lib/container/FallbackModuleFactory.js +0 -35
  287. package/src/lib/container/FallbackModuleFactory.js.map +0 -1
  288. package/src/lib/container/HoistContainerReferencesPlugin.d.ts +0 -19
  289. package/src/lib/container/HoistContainerReferencesPlugin.js +0 -78
  290. package/src/lib/container/HoistContainerReferencesPlugin.js.map +0 -1
  291. package/src/lib/container/ModuleFederationPlugin.d.js +0 -4
  292. package/src/lib/container/ModuleFederationPlugin.d.js.map +0 -1
  293. package/src/lib/container/ModuleFederationPlugin.d.ts +0 -16
  294. package/src/lib/container/ModuleFederationPlugin.js +0 -85
  295. package/src/lib/container/ModuleFederationPlugin.js.map +0 -1
  296. package/src/lib/container/ModuleFederationPluginTypes.d.js +0 -12
  297. package/src/lib/container/ModuleFederationPluginTypes.d.js.map +0 -1
  298. package/src/lib/container/RemoteModule.d.js +0 -13
  299. package/src/lib/container/RemoteModule.d.js.map +0 -1
  300. package/src/lib/container/RemoteModule.d.ts +0 -76
  301. package/src/lib/container/RemoteModule.js +0 -151
  302. package/src/lib/container/RemoteModule.js.map +0 -1
  303. package/src/lib/container/RemoteRuntimeModule.d.js +0 -13
  304. package/src/lib/container/RemoteRuntimeModule.d.js.map +0 -1
  305. package/src/lib/container/RemoteRuntimeModule.d.ts +0 -9
  306. package/src/lib/container/RemoteRuntimeModule.js +0 -124
  307. package/src/lib/container/RemoteRuntimeModule.js.map +0 -1
  308. package/src/lib/container/RemoteToExternalDependency.d.js +0 -19
  309. package/src/lib/container/RemoteToExternalDependency.d.js.map +0 -1
  310. package/src/lib/container/RemoteToExternalDependency.js +0 -37
  311. package/src/lib/container/RemoteToExternalDependency.js.map +0 -1
  312. package/src/lib/container/options.d.js +0 -6
  313. package/src/lib/container/options.d.js.map +0 -1
  314. package/src/lib/container/options.js.map +0 -1
  315. package/src/lib/inversion/ContainerInversionPlugin.d.ts +0 -1
  316. package/src/lib/inversion/ContainerInversionPlugin.js +0 -3
  317. package/src/lib/inversion/ContainerInversionPlugin.js.map +0 -1
  318. package/src/lib/sharing/ConsumeSharedFallbackDependency.d.js +0 -4
  319. package/src/lib/sharing/ConsumeSharedFallbackDependency.d.js.map +0 -1
  320. package/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +0 -10
  321. package/src/lib/sharing/ConsumeSharedFallbackDependency.js +0 -37
  322. package/src/lib/sharing/ConsumeSharedFallbackDependency.js.map +0 -1
  323. package/src/lib/sharing/ConsumeSharedModule.d.js +0 -4
  324. package/src/lib/sharing/ConsumeSharedModule.d.js.map +0 -1
  325. package/src/lib/sharing/ConsumeSharedModule.d.ts +0 -106
  326. package/src/lib/sharing/ConsumeSharedModule.js +0 -235
  327. package/src/lib/sharing/ConsumeSharedModule.js.map +0 -1
  328. package/src/lib/sharing/ConsumeSharedPlugin.d.js +0 -4
  329. package/src/lib/sharing/ConsumeSharedPlugin.d.js.map +0 -1
  330. package/src/lib/sharing/ConsumeSharedPlugin.d.ts +0 -8
  331. package/src/lib/sharing/ConsumeSharedPlugin.js +0 -274
  332. package/src/lib/sharing/ConsumeSharedPlugin.js.map +0 -1
  333. package/src/lib/sharing/ConsumeSharedRuntimeModule.d.js +0 -4
  334. package/src/lib/sharing/ConsumeSharedRuntimeModule.d.js.map +0 -1
  335. package/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +0 -13
  336. package/src/lib/sharing/ConsumeSharedRuntimeModule.js +0 -294
  337. package/src/lib/sharing/ConsumeSharedRuntimeModule.js.map +0 -1
  338. package/src/lib/sharing/ProvideForSharedDependency.d.js +0 -4
  339. package/src/lib/sharing/ProvideForSharedDependency.d.js.map +0 -1
  340. package/src/lib/sharing/ProvideForSharedDependency.d.ts +0 -11
  341. package/src/lib/sharing/ProvideForSharedDependency.js +0 -38
  342. package/src/lib/sharing/ProvideForSharedDependency.js.map +0 -1
  343. package/src/lib/sharing/ProvideSharedDependency.d.js +0 -14
  344. package/src/lib/sharing/ProvideSharedDependency.d.js.map +0 -1
  345. package/src/lib/sharing/ProvideSharedDependency.d.ts +0 -32
  346. package/src/lib/sharing/ProvideSharedDependency.js +0 -69
  347. package/src/lib/sharing/ProvideSharedDependency.js.map +0 -1
  348. package/src/lib/sharing/ProvideSharedModule.d.js +0 -4
  349. package/src/lib/sharing/ProvideSharedModule.d.js.map +0 -1
  350. package/src/lib/sharing/ProvideSharedModule.d.ts +0 -79
  351. package/src/lib/sharing/ProvideSharedModule.js +0 -203
  352. package/src/lib/sharing/ProvideSharedModule.js.map +0 -1
  353. package/src/lib/sharing/ProvideSharedModuleFactory.d.js +0 -4
  354. package/src/lib/sharing/ProvideSharedModuleFactory.d.js.map +0 -1
  355. package/src/lib/sharing/ProvideSharedModuleFactory.d.ts +0 -11
  356. package/src/lib/sharing/ProvideSharedModuleFactory.js +0 -36
  357. package/src/lib/sharing/ProvideSharedModuleFactory.js.map +0 -1
  358. package/src/lib/sharing/ProvideSharedPlugin.d.js +0 -4
  359. package/src/lib/sharing/ProvideSharedPlugin.d.js.map +0 -1
  360. package/src/lib/sharing/ProvideSharedPlugin.d.ts +0 -34
  361. package/src/lib/sharing/ProvideSharedPlugin.js +0 -182
  362. package/src/lib/sharing/ProvideSharedPlugin.js.map +0 -1
  363. package/src/lib/sharing/SharePlugin.d.js +0 -4
  364. package/src/lib/sharing/SharePlugin.d.js.map +0 -1
  365. package/src/lib/sharing/SharePlugin.d.ts +0 -15
  366. package/src/lib/sharing/SharePlugin.js +0 -77
  367. package/src/lib/sharing/SharePlugin.js.map +0 -1
  368. package/src/lib/sharing/ShareRuntimeModule.d.js +0 -4
  369. package/src/lib/sharing/ShareRuntimeModule.d.js.map +0 -1
  370. package/src/lib/sharing/ShareRuntimeModule.d.ts +0 -9
  371. package/src/lib/sharing/ShareRuntimeModule.js +0 -161
  372. package/src/lib/sharing/ShareRuntimeModule.js.map +0 -1
  373. package/src/lib/sharing/resolveMatchedConfigs.d.js +0 -6
  374. package/src/lib/sharing/resolveMatchedConfigs.d.js.map +0 -1
  375. package/src/lib/sharing/resolveMatchedConfigs.d.ts +0 -8
  376. package/src/lib/sharing/resolveMatchedConfigs.js +0 -73
  377. package/src/lib/sharing/resolveMatchedConfigs.js.map +0 -1
  378. package/src/lib/sharing/utils.d.js +0 -6
  379. package/src/lib/sharing/utils.d.js.map +0 -1
  380. package/src/lib/sharing/utils.d.ts +0 -33
  381. package/src/lib/sharing/utils.js.map +0 -1
  382. package/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js +0 -34
  383. package/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js.map +0 -1
  384. package/src/runtime/ModuleInfoRuntimeModule.d.ts +0 -16
  385. package/src/runtime/ModuleInfoRuntimeModule.js +0 -88
  386. package/src/runtime/ModuleInfoRuntimeModule.js.map +0 -1
  387. package/src/runtime/ModuleInfoRuntimePlugin.d.ts +0 -5
  388. package/src/runtime/ModuleInfoRuntimePlugin.js +0 -29
  389. package/src/runtime/ModuleInfoRuntimePlugin.js.map +0 -1
  390. package/src/schemas/container/ModuleFederationPlugin.check.js +0 -2245
  391. package/src/schemas/container/ModuleFederationPlugin.check.js.map +0 -1
  392. package/src/schemas/container/ModuleFederationPlugin.js.map +0 -1
  393. /package/{src → dist/src}/lib/Constants.d.ts +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/FallbackDependency.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy\n*/\n\n'use strict';\n\nimport type {\n ObjectDeserializerContext,\n ObjectSerializerContext,\n} from 'webpack/lib/Dependency';\nimport Dependency from 'webpack/lib/Dependency';\nimport makeSerializable from 'webpack/lib/util/makeSerializable';\n\nclass FallbackDependency extends Dependency {\n requests: string[];\n\n /**\n * @param {string[]} requests requests\n */\n constructor(requests: string[]) {\n super();\n this.requests = requests;\n }\n\n /**\n * @returns {string | null} an identifier to merge equal requests\n */\n override getResourceIdentifier(): string | null {\n return `fallback ${this.requests.join(' ')}`;\n }\n\n override get type(): string {\n return 'fallback';\n }\n\n override get category(): string {\n return 'esm';\n }\n\n /**\n * @param {ObjectSerializerContext} context context\n */\n override serialize(context: ObjectSerializerContext): void {\n const { write } = context;\n write(this.requests);\n super.serialize(context);\n }\n\n /**\n * @param {ObjectDeserializerContext} context context\n * @returns {FallbackDependency} deserialize fallback dependency\n */\n static deserialize(context: ObjectDeserializerContext): FallbackDependency {\n const { read } = context;\n const obj = new FallbackDependency(read());\n obj.deserialize(context);\n return obj;\n }\n}\n\nmakeSerializable(\n FallbackDependency,\n 'enhanced/lib/container/FallbackDependency',\n);\n\nexport default FallbackDependency;\n"],"names":["FallbackDependency","Dependency","getResourceIdentifier","requests","join","type","category","serialize","context","write","deserialize","read","obj","constructor","makeSerializable"],"mappings":"AAAA;;;AAGA,GAEA;;;;+BA6DA;;;eAAA;;;mEAvDuB;yEACM;;;;;;AAE7B,IAAA,AAAMA,qBAAN,MAAMA,2BAA2BC,mBAAU;IAWzC;;GAEC,GACD,AAASC,wBAAuC;QAC9C,OAAO,CAAC,SAAS,EAAE,IAAI,CAACC,QAAQ,CAACC,IAAI,CAAC,KAAK,CAAC;IAC9C;IAEA,IAAaC,OAAe;QAC1B,OAAO;IACT;IAEA,IAAaC,WAAmB;QAC9B,OAAO;IACT;IAEA;;GAEC,GACD,AAASC,UAAUC,OAAgC,EAAQ;QACzD,MAAM,EAAEC,KAAK,EAAE,GAAGD;QAClBC,MAAM,IAAI,CAACN,QAAQ;QACnB,KAAK,CAACI,UAAUC;IAClB;IAEA;;;GAGC,GACD,OAAOE,YAAYF,OAAkC,EAAsB;QACzE,MAAM,EAAEG,IAAI,EAAE,GAAGH;QACjB,MAAMI,MAAM,IAAIZ,mBAAmBW;QACnCC,IAAIF,WAAW,CAACF;QAChB,OAAOI;IACT;IAzCA;;GAEC,GACDC,YAAYV,QAAkB,CAAE;QAC9B,KAAK;QACL,IAAI,CAACA,QAAQ,GAAGA;IAClB;AAoCF;AAEAW,IAAAA,yBAAgB,EACdd,oBACA;MAGF,WAAeA"}
@@ -1,4 +0,0 @@
1
- "use strict";
2
- module.exports = FallbackItemDependency;
3
-
4
- //# sourceMappingURL=FallbackItemDependency.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/FallbackItemDependency.d.ts"],"sourcesContent":["export = FallbackItemDependency;\ndeclare class FallbackItemDependency extends ModuleDependency {}\nimport ModuleDependency = require('webpack/lib/dependencies/ModuleDependency');\n"],"names":["FallbackItemDependency"],"mappings":";iBAASA"}
@@ -1,10 +0,0 @@
1
- import ModuleDependency from 'webpack/lib/dependencies/ModuleDependency';
2
- declare class FallbackItemDependency extends 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,37 +0,0 @@
1
- /*
2
- MIT License http://www.opensource.org/licenses/mit-license.php
3
- Author Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy
4
- */ "use strict";
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- Object.defineProperty(exports, "default", {
9
- enumerable: true,
10
- get: function() {
11
- return _default;
12
- }
13
- });
14
- const _ModuleDependency = /*#__PURE__*/ _interop_require_default(require("webpack/lib/dependencies/ModuleDependency"));
15
- const _makeSerializable = /*#__PURE__*/ _interop_require_default(require("webpack/lib/util/makeSerializable"));
16
- function _interop_require_default(obj) {
17
- return obj && obj.__esModule ? obj : {
18
- default: obj
19
- };
20
- }
21
- let FallbackItemDependency = class FallbackItemDependency extends _ModuleDependency.default {
22
- get type() {
23
- return 'fallback item';
24
- }
25
- get category() {
26
- return 'esm';
27
- }
28
- /**
29
- * @param {string} request request
30
- */ constructor(request){
31
- super(request);
32
- }
33
- };
34
- (0, _makeSerializable.default)(FallbackItemDependency, 'enhanced/lib/container/FallbackItemDependency');
35
- const _default = FallbackItemDependency;
36
-
37
- //# sourceMappingURL=FallbackItemDependency.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/FallbackItemDependency.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy\n*/\nimport ModuleDependency from 'webpack/lib/dependencies/ModuleDependency';\nimport makeSerializable from 'webpack/lib/util/makeSerializable';\n\nclass FallbackItemDependency extends ModuleDependency {\n /**\n * @param {string} request request\n */\n constructor(request: string) {\n super(request);\n }\n\n override get type(): string {\n return 'fallback item';\n }\n\n override get category(): string {\n return 'esm';\n }\n}\n\nmakeSerializable(\n FallbackItemDependency,\n 'enhanced/lib/container/FallbackItemDependency',\n);\n\nexport default FallbackItemDependency;\n"],"names":["FallbackItemDependency","ModuleDependency","type","category","constructor","request","makeSerializable"],"mappings":"AAAA;;;AAGA;;;;+BA0BA;;;eAAA;;;yEAzB6B;yEACA;;;;;;AAE7B,IAAA,AAAMA,yBAAN,MAAMA,+BAA+BC,yBAAgB;IAQnD,IAAaC,OAAe;QAC1B,OAAO;IACT;IAEA,IAAaC,WAAmB;QAC9B,OAAO;IACT;IAbA;;GAEC,GACDC,YAAYC,OAAe,CAAE;QAC3B,KAAK,CAACA;IACR;AASF;AAEAC,IAAAA,yBAAgB,EACdN,wBACA;MAGF,WAAeA"}
@@ -1,4 +0,0 @@
1
- "use strict";
2
- module.exports = FallbackModule;
3
-
4
- //# sourceMappingURL=FallbackModule.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/FallbackModule.d.ts"],"sourcesContent":["export = FallbackModule;\ndeclare class FallbackModule extends Module {\n /**\n * @param {ObjectDeserializerContext} context context\n * @returns {FallbackModule} deserialized fallback module\n */\n static deserialize(context: ObjectDeserializerContext): FallbackModule;\n /**\n * @param {string[]} requests list of requests to choose one\n */\n constructor(requests: string[]);\n requests: string[];\n _identifier: string;\n}\ndeclare namespace FallbackModule {\n export {\n WebpackOptions,\n Chunk,\n ChunkGraph,\n ChunkGroup,\n Compilation,\n CodeGenerationContext,\n CodeGenerationResult,\n LibIdentOptions,\n NeedBuildContext,\n RequestShortener,\n ResolverWithOptions,\n WebpackError,\n ObjectDeserializerContext,\n ObjectSerializerContext,\n Hash,\n InputFileSystem,\n };\n}\nimport Module = require('webpack/lib/Module');\ntype ObjectDeserializerContext =\n import('webpack/lib/serialization/ObjectMiddleware').ObjectDeserializerContext;\ntype WebpackOptions = any;\ntype Chunk = import('webpack/lib/Chunk');\ntype ChunkGraph = import('webpack/lib/ChunkGraph');\ntype ChunkGroup = import('webpack/lib/ChunkGroup');\ntype Compilation = import('webpack/lib/Compilation');\ntype CodeGenerationContext = import('webpack/lib/Module').CodeGenerationContext;\ntype CodeGenerationResult = import('webpack/lib/Module').CodeGenerationResult;\ntype LibIdentOptions = import('webpack/lib/Module').LibIdentOptions;\ntype NeedBuildContext = import('webpack/lib/Module').NeedBuildContext;\ntype RequestShortener = import('webpack/lib/RequestShortener');\ntype ResolverWithOptions =\n import('webpack/lib/ResolverFactory').ResolverWithOptions;\ntype WebpackError = import('webpack/lib/WebpackError');\ntype ObjectSerializerContext =\n import('webpack/lib/serialization/ObjectMiddleware').ObjectSerializerContext;\ntype Hash = import('webpack/lib/util/Hash');\ntype InputFileSystem = import('webpack/lib/util/fs').InputFileSystem;\n"],"names":["FallbackModule"],"mappings":";iBAASA"}
@@ -1,73 +0,0 @@
1
- import type { RequestShortener, LibIdentOptions, CodeGenerationContext, CodeGenerationResult, NeedBuildContext, WebpackError, ResolverWithOptions, InputFileSystem, Compilation, WebpackOptions, ObjectDeserializerContext, ObjectSerializerContext } from 'webpack/lib/Module';
2
- import Module from 'webpack/lib/Module';
3
- import type ChunkGraph from 'webpack/lib/ChunkGraph';
4
- import Chunk from 'webpack/lib/Chunk';
5
- declare class FallbackModule extends Module {
6
- private requests;
7
- private _identifier;
8
- /**
9
- * @param {string[]} requests list of requests to choose one
10
- */
11
- constructor(requests: string[]);
12
- /**
13
- * @returns {string} a unique identifier of the module
14
- */
15
- identifier(): string;
16
- /**
17
- * @param {RequestShortener} requestShortener the request shortener
18
- * @returns {string} a user readable identifier of the module
19
- */
20
- readableIdentifier(requestShortener: RequestShortener): string;
21
- /**
22
- * @param {LibIdentOptions} options options
23
- * @returns {string | null} an identifier for library inclusion
24
- */
25
- libIdent(options: LibIdentOptions): string | null;
26
- /**
27
- * @param {Chunk} chunk the chunk which condition should be checked
28
- * @param {Compilation} compilation the compilation
29
- * @returns {boolean} true, if the chunk is ok for the module
30
- */
31
- chunkCondition(chunk: Chunk, { chunkGraph }: {
32
- chunkGraph: ChunkGraph;
33
- }): boolean;
34
- /**
35
- * @param {NeedBuildContext} context context info
36
- * @param {function((WebpackError | null)=, boolean=): void} callback callback function, returns true, if the module needs a rebuild
37
- * @returns {void}
38
- */
39
- needBuild(context: NeedBuildContext, callback: (error: WebpackError | null, result?: boolean) => void): void;
40
- /**
41
- * @param {WebpackOptions} options webpack options
42
- * @param {Compilation} compilation the compilation
43
- * @param {ResolverWithOptions} resolver the resolver
44
- * @param {InputFileSystem} fs the file system
45
- * @param {function(WebpackError=): void} callback callback function
46
- * @returns {void}
47
- */
48
- build(options: WebpackOptions, compilation: Compilation, resolver: ResolverWithOptions, fs: InputFileSystem, callback: (error?: WebpackError) => void): void;
49
- /**
50
- * @param {string=} type the source type for which the size should be estimated
51
- * @returns {number} the estimated size of the module (must be non-zero)
52
- */
53
- size(type?: string): number;
54
- /**
55
- * @returns {Set<string>} types available (do not mutate)
56
- */
57
- getSourceTypes(): Set<string>;
58
- /**
59
- * @param {CodeGenerationContext} context context for code generation
60
- * @returns {CodeGenerationResult} result
61
- */
62
- codeGeneration({ runtimeTemplate, moduleGraph, chunkGraph, }: CodeGenerationContext): CodeGenerationResult;
63
- /**
64
- * @param {ObjectSerializerContext} context context
65
- */
66
- serialize(context: ObjectSerializerContext): void;
67
- /**
68
- * @param {ObjectDeserializerContext} context context
69
- * @returns {FallbackModule} deserialized fallback module
70
- */
71
- static deserialize(context: ObjectDeserializerContext): FallbackModule;
72
- }
73
- export default FallbackModule;
@@ -1,153 +0,0 @@
1
- /*
2
- MIT License http://www.opensource.org/licenses/mit-license.php
3
- Author Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy
4
- */ 'use strict';
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- Object.defineProperty(exports, "default", {
9
- enumerable: true,
10
- get: function() {
11
- return _default;
12
- }
13
- });
14
- const _webpacksources = require("webpack-sources");
15
- const _Module = /*#__PURE__*/ _interop_require_default(require("webpack/lib/Module"));
16
- const _ModuleTypeConstants = require("webpack/lib/ModuleTypeConstants");
17
- const _RuntimeGlobals = /*#__PURE__*/ _interop_require_default(require("webpack/lib/RuntimeGlobals"));
18
- const _Template = /*#__PURE__*/ _interop_require_default(require("webpack/lib/Template"));
19
- const _makeSerializable = /*#__PURE__*/ _interop_require_default(require("webpack/lib/util/makeSerializable"));
20
- const _FallbackItemDependency = /*#__PURE__*/ _interop_require_default(require("./FallbackItemDependency"));
21
- function _interop_require_default(obj) {
22
- return obj && obj.__esModule ? obj : {
23
- default: obj
24
- };
25
- }
26
- const TYPES = new Set([
27
- 'javascript'
28
- ]);
29
- const RUNTIME_REQUIREMENTS = new Set([
30
- _RuntimeGlobals.default.module
31
- ]);
32
- let FallbackModule = class FallbackModule extends _Module.default {
33
- /**
34
- * @returns {string} a unique identifier of the module
35
- */ identifier() {
36
- return this._identifier;
37
- }
38
- /**
39
- * @param {RequestShortener} requestShortener the request shortener
40
- * @returns {string} a user readable identifier of the module
41
- */ readableIdentifier(requestShortener) {
42
- return this._identifier;
43
- }
44
- /**
45
- * @param {LibIdentOptions} options options
46
- * @returns {string | null} an identifier for library inclusion
47
- */ libIdent(options) {
48
- return `${this.layer ? `(${this.layer})/` : ''}webpack/container/fallback/${this.requests[0]}/and ${this.requests.length - 1} more`;
49
- }
50
- /**
51
- * @param {Chunk} chunk the chunk which condition should be checked
52
- * @param {Compilation} compilation the compilation
53
- * @returns {boolean} true, if the chunk is ok for the module
54
- */ chunkCondition(chunk, { chunkGraph }) {
55
- return chunkGraph.getNumberOfEntryModules(chunk) > 0;
56
- }
57
- /**
58
- * @param {NeedBuildContext} context context info
59
- * @param {function((WebpackError | null)=, boolean=): void} callback callback function, returns true, if the module needs a rebuild
60
- * @returns {void}
61
- */ needBuild(context, callback) {
62
- callback(null, !this.buildInfo);
63
- }
64
- /**
65
- * @param {WebpackOptions} options webpack options
66
- * @param {Compilation} compilation the compilation
67
- * @param {ResolverWithOptions} resolver the resolver
68
- * @param {InputFileSystem} fs the file system
69
- * @param {function(WebpackError=): void} callback callback function
70
- * @returns {void}
71
- */ build(options, compilation, resolver, fs, callback) {
72
- this.buildMeta = {};
73
- this.buildInfo = {
74
- strict: true
75
- };
76
- this.clearDependenciesAndBlocks();
77
- for (const request of this.requests)this.addDependency(new _FallbackItemDependency.default(request));
78
- callback();
79
- }
80
- /**
81
- * @param {string=} type the source type for which the size should be estimated
82
- * @returns {number} the estimated size of the module (must be non-zero)
83
- */ size(type) {
84
- return this.requests.length * 5 + 42;
85
- }
86
- /**
87
- * @returns {Set<string>} types available (do not mutate)
88
- */ getSourceTypes() {
89
- return TYPES;
90
- }
91
- /**
92
- * @param {CodeGenerationContext} context context for code generation
93
- * @returns {CodeGenerationResult} result
94
- */ codeGeneration({ runtimeTemplate, moduleGraph, chunkGraph }) {
95
- const ids = this.dependencies.map((dep)=>//@ts-ignore
96
- chunkGraph.getModuleId(moduleGraph.getModule(dep)));
97
- const code = _Template.default.asString([
98
- `var ids = ${JSON.stringify(ids)};`,
99
- 'var error, result, i = 0;',
100
- `var loop = ${runtimeTemplate.basicFunction('next', [
101
- 'while(i < ids.length) {',
102
- _Template.default.indent([
103
- `try { next = ${_RuntimeGlobals.default.require}(ids[i++]); } catch(e) { return handleError(e); }`,
104
- 'if(next) return next.then ? next.then(handleResult, handleError) : handleResult(next);'
105
- ]),
106
- '}',
107
- 'if(error) throw error;'
108
- ])}`,
109
- `var handleResult = ${runtimeTemplate.basicFunction('result', [
110
- 'if(result) return result;',
111
- 'return loop();'
112
- ])};`,
113
- `var handleError = ${runtimeTemplate.basicFunction('e', [
114
- 'error = e;',
115
- 'return loop();'
116
- ])};`,
117
- 'module.exports = loop();'
118
- ]);
119
- const sources = new Map();
120
- sources.set('javascript', new _webpacksources.RawSource(code));
121
- return {
122
- sources,
123
- runtimeRequirements: RUNTIME_REQUIREMENTS
124
- };
125
- }
126
- /**
127
- * @param {ObjectSerializerContext} context context
128
- */ serialize(context) {
129
- const { write } = context;
130
- write(this.requests);
131
- super.serialize(context);
132
- }
133
- /**
134
- * @param {ObjectDeserializerContext} context context
135
- * @returns {FallbackModule} deserialized fallback module
136
- */ static deserialize(context) {
137
- const { read } = context;
138
- const obj = new FallbackModule(read());
139
- obj.deserialize(context);
140
- return obj;
141
- }
142
- /**
143
- * @param {string[]} requests list of requests to choose one
144
- */ constructor(requests){
145
- super(_ModuleTypeConstants.WEBPACK_MODULE_TYPE_FALLBACK);
146
- this.requests = requests;
147
- this._identifier = `fallback ${this.requests.join(' ')}`;
148
- }
149
- };
150
- (0, _makeSerializable.default)(FallbackModule, 'enhanced/lib/container/FallbackModule');
151
- const _default = FallbackModule;
152
-
153
- //# sourceMappingURL=FallbackModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/FallbackModule.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy\n*/\n\n'use strict';\n\nimport { RawSource } from 'webpack-sources';\nimport type {\n RequestShortener,\n LibIdentOptions,\n CodeGenerationContext,\n CodeGenerationResult,\n NeedBuildContext,\n WebpackError,\n ResolverWithOptions,\n InputFileSystem,\n Compilation,\n WebpackOptions,\n ObjectDeserializerContext,\n ObjectSerializerContext,\n} from 'webpack/lib/Module';\nimport Module from 'webpack/lib/Module';\nimport type ChunkGraph from 'webpack/lib/ChunkGraph';\nimport Chunk from 'webpack/lib/Chunk';\nimport { WEBPACK_MODULE_TYPE_FALLBACK } from 'webpack/lib/ModuleTypeConstants';\nimport RuntimeGlobals from 'webpack/lib/RuntimeGlobals';\nimport Template from 'webpack/lib/Template';\nimport makeSerializable from 'webpack/lib/util/makeSerializable';\nimport FallbackItemDependency from './FallbackItemDependency';\n\nconst TYPES = new Set(['javascript']);\nconst RUNTIME_REQUIREMENTS = new Set([RuntimeGlobals.module]);\n\nclass FallbackModule extends Module {\n private requests: string[];\n private _identifier: string;\n\n /**\n * @param {string[]} requests list of requests to choose one\n */\n constructor(requests: string[]) {\n super(WEBPACK_MODULE_TYPE_FALLBACK);\n this.requests = requests;\n this._identifier = `fallback ${this.requests.join(' ')}`;\n }\n\n /**\n * @returns {string} a unique identifier of the module\n */\n override identifier(): string {\n return this._identifier;\n }\n\n /**\n * @param {RequestShortener} requestShortener the request shortener\n * @returns {string} a user readable identifier of the module\n */\n override readableIdentifier(requestShortener: RequestShortener): string {\n return this._identifier;\n }\n\n /**\n * @param {LibIdentOptions} options options\n * @returns {string | null} an identifier for library inclusion\n */\n override libIdent(options: LibIdentOptions): string | null {\n return `${this.layer ? `(${this.layer})/` : ''}webpack/container/fallback/${\n this.requests[0]\n }/and ${this.requests.length - 1} more`;\n }\n\n /**\n * @param {Chunk} chunk the chunk which condition should be checked\n * @param {Compilation} compilation the compilation\n * @returns {boolean} true, if the chunk is ok for the module\n */\n override chunkCondition(\n chunk: Chunk,\n { chunkGraph }: { chunkGraph: ChunkGraph },\n ): boolean {\n return chunkGraph.getNumberOfEntryModules(chunk) > 0;\n }\n\n /**\n * @param {NeedBuildContext} context context info\n * @param {function((WebpackError | null)=, boolean=): void} callback callback function, returns true, if the module needs a rebuild\n * @returns {void}\n */\n override needBuild(\n context: NeedBuildContext,\n callback: (error: WebpackError | null, result?: boolean) => void,\n ): void {\n callback(null, !this.buildInfo);\n }\n\n /**\n * @param {WebpackOptions} options webpack options\n * @param {Compilation} compilation the compilation\n * @param {ResolverWithOptions} resolver the resolver\n * @param {InputFileSystem} fs the file system\n * @param {function(WebpackError=): void} callback callback function\n * @returns {void}\n */\n override build(\n options: WebpackOptions,\n compilation: Compilation,\n resolver: ResolverWithOptions,\n fs: InputFileSystem,\n callback: (error?: WebpackError) => void,\n ): void {\n this.buildMeta = {};\n this.buildInfo = {\n strict: true,\n };\n\n this.clearDependenciesAndBlocks();\n for (const request of this.requests)\n this.addDependency(new FallbackItemDependency(request));\n\n callback();\n }\n\n /**\n * @param {string=} type the source type for which the size should be estimated\n * @returns {number} the estimated size of the module (must be non-zero)\n */\n override size(type?: string): number {\n return this.requests.length * 5 + 42;\n }\n\n /**\n * @returns {Set<string>} types available (do not mutate)\n */\n override getSourceTypes(): Set<string> {\n return TYPES;\n }\n\n /**\n * @param {CodeGenerationContext} context context for code generation\n * @returns {CodeGenerationResult} result\n */\n override codeGeneration({\n runtimeTemplate,\n moduleGraph,\n chunkGraph,\n }: CodeGenerationContext): CodeGenerationResult {\n const ids = this.dependencies.map((dep) =>\n //@ts-ignore\n chunkGraph.getModuleId(moduleGraph.getModule(dep)),\n );\n const code = Template.asString([\n `var ids = ${JSON.stringify(ids)};`,\n 'var error, result, i = 0;',\n `var loop = ${runtimeTemplate.basicFunction('next', [\n 'while(i < ids.length) {',\n Template.indent([\n `try { next = ${RuntimeGlobals.require}(ids[i++]); } catch(e) { return handleError(e); }`,\n 'if(next) return next.then ? next.then(handleResult, handleError) : handleResult(next);',\n ]),\n '}',\n 'if(error) throw error;',\n ])}`,\n `var handleResult = ${runtimeTemplate.basicFunction('result', [\n 'if(result) return result;',\n 'return loop();',\n ])};`,\n `var handleError = ${runtimeTemplate.basicFunction('e', [\n 'error = e;',\n 'return loop();',\n ])};`,\n 'module.exports = loop();',\n ]);\n const sources = new Map();\n sources.set('javascript', new RawSource(code));\n return { sources, runtimeRequirements: RUNTIME_REQUIREMENTS };\n }\n\n /**\n * @param {ObjectSerializerContext} context context\n */\n override serialize(context: ObjectSerializerContext): void {\n const { write } = context;\n write(this.requests);\n super.serialize(context);\n }\n\n /**\n * @param {ObjectDeserializerContext} context context\n * @returns {FallbackModule} deserialized fallback module\n */\n static deserialize(context: ObjectDeserializerContext): FallbackModule {\n const { read } = context;\n const obj = new FallbackModule(read());\n obj.deserialize(context);\n return obj;\n }\n}\n\nmakeSerializable(FallbackModule, 'enhanced/lib/container/FallbackModule');\n\nexport default FallbackModule;\n"],"names":["TYPES","Set","RUNTIME_REQUIREMENTS","RuntimeGlobals","module","FallbackModule","Module","identifier","_identifier","readableIdentifier","requestShortener","libIdent","options","layer","requests","length","chunkCondition","chunk","chunkGraph","getNumberOfEntryModules","needBuild","context","callback","buildInfo","build","compilation","resolver","fs","buildMeta","strict","clearDependenciesAndBlocks","request","addDependency","FallbackItemDependency","size","type","getSourceTypes","codeGeneration","runtimeTemplate","moduleGraph","ids","dependencies","map","dep","getModuleId","getModule","code","Template","asString","JSON","stringify","basicFunction","indent","require","sources","Map","set","RawSource","runtimeRequirements","serialize","write","deserialize","read","obj","constructor","WEBPACK_MODULE_TYPE_FALLBACK","join","makeSerializable"],"mappings":"AAAA;;;AAGA,GAEA;;;;+BAoMA;;;eAAA;;;gCAlM0B;+DAeP;qCAG0B;uEAClB;iEACN;yEACQ;+EACM;;;;;;AAEnC,MAAMA,QAAQ,IAAIC,IAAI;IAAC;CAAa;AACpC,MAAMC,uBAAuB,IAAID,IAAI;IAACE,uBAAc,CAACC,MAAM;CAAC;AAE5D,IAAA,AAAMC,iBAAN,MAAMA,uBAAuBC,eAAM;IAajC;;GAEC,GACD,AAASC,aAAqB;QAC5B,OAAO,IAAI,CAACC,WAAW;IACzB;IAEA;;;GAGC,GACD,AAASC,mBAAmBC,gBAAkC,EAAU;QACtE,OAAO,IAAI,CAACF,WAAW;IACzB;IAEA;;;GAGC,GACD,AAASG,SAASC,OAAwB,EAAiB;QACzD,OAAO,CAAC,EAAE,IAAI,CAACC,KAAK,GAAG,CAAC,CAAC,EAAE,IAAI,CAACA,KAAK,CAAC,EAAE,CAAC,GAAG,GAAG,2BAA2B,EACxE,IAAI,CAACC,QAAQ,CAAC,EAAE,CACjB,KAAK,EAAE,IAAI,CAACA,QAAQ,CAACC,MAAM,GAAG,EAAE,KAAK,CAAC;IACzC;IAEA;;;;GAIC,GACD,AAASC,eACPC,KAAY,EACZ,EAAEC,UAAU,EAA8B,EACjC;QACT,OAAOA,WAAWC,uBAAuB,CAACF,SAAS;IACrD;IAEA;;;;GAIC,GACD,AAASG,UACPC,OAAyB,EACzBC,QAAgE,EAC1D;QACNA,SAAS,MAAM,CAAC,IAAI,CAACC,SAAS;IAChC;IAEA;;;;;;;GAOC,GACD,AAASC,MACPZ,OAAuB,EACvBa,WAAwB,EACxBC,QAA6B,EAC7BC,EAAmB,EACnBL,QAAwC,EAClC;QACN,IAAI,CAACM,SAAS,GAAG,CAAC;QAClB,IAAI,CAACL,SAAS,GAAG;YACfM,QAAQ;QACV;QAEA,IAAI,CAACC,0BAA0B;QAC/B,KAAK,MAAMC,WAAW,IAAI,CAACjB,QAAQ,CACjC,IAAI,CAACkB,aAAa,CAAC,IAAIC,+BAAsB,CAACF;QAEhDT;IACF;IAEA;;;GAGC,GACD,AAASY,KAAKC,IAAa,EAAU;QACnC,OAAO,IAAI,CAACrB,QAAQ,CAACC,MAAM,GAAG,IAAI;IACpC;IAEA;;GAEC,GACD,AAASqB,iBAA8B;QACrC,OAAOpC;IACT;IAEA;;;GAGC,GACD,AAASqC,eAAe,EACtBC,eAAe,EACfC,WAAW,EACXrB,UAAU,EACY,EAAwB;QAC9C,MAAMsB,MAAM,IAAI,CAACC,YAAY,CAACC,GAAG,CAAC,CAACC,MACjC,YAAY;YACZzB,WAAW0B,WAAW,CAACL,YAAYM,SAAS,CAACF;QAE/C,MAAMG,OAAOC,iBAAQ,CAACC,QAAQ,CAAC;YAC7B,CAAC,UAAU,EAAEC,KAAKC,SAAS,CAACV,KAAK,CAAC,CAAC;YACnC;YACA,CAAC,WAAW,EAAEF,gBAAgBa,aAAa,CAAC,QAAQ;gBAClD;gBACAJ,iBAAQ,CAACK,MAAM,CAAC;oBACd,CAAC,aAAa,EAAEjD,uBAAc,CAACkD,OAAO,CAAC,iDAAiD,CAAC;oBACzF;iBACD;gBACD;gBACA;aACD,EAAE,CAAC;YACJ,CAAC,mBAAmB,EAAEf,gBAAgBa,aAAa,CAAC,UAAU;gBAC5D;gBACA;aACD,EAAE,CAAC,CAAC;YACL,CAAC,kBAAkB,EAAEb,gBAAgBa,aAAa,CAAC,KAAK;gBACtD;gBACA;aACD,EAAE,CAAC,CAAC;YACL;SACD;QACD,MAAMG,UAAU,IAAIC;QACpBD,QAAQE,GAAG,CAAC,cAAc,IAAIC,yBAAS,CAACX;QACxC,OAAO;YAAEQ;YAASI,qBAAqBxD;QAAqB;IAC9D;IAEA;;GAEC,GACD,AAASyD,UAAUtC,OAAgC,EAAQ;QACzD,MAAM,EAAEuC,KAAK,EAAE,GAAGvC;QAClBuC,MAAM,IAAI,CAAC9C,QAAQ;QACnB,KAAK,CAAC6C,UAAUtC;IAClB;IAEA;;;GAGC,GACD,OAAOwC,YAAYxC,OAAkC,EAAkB;QACrE,MAAM,EAAEyC,IAAI,EAAE,GAAGzC;QACjB,MAAM0C,MAAM,IAAI1D,eAAeyD;QAC/BC,IAAIF,WAAW,CAACxC;QAChB,OAAO0C;IACT;IA9JA;;GAEC,GACDC,YAAYlD,QAAkB,CAAE;QAC9B,KAAK,CAACmD,iDAA4B;QAClC,IAAI,CAACnD,QAAQ,GAAGA;QAChB,IAAI,CAACN,WAAW,GAAG,CAAC,SAAS,EAAE,IAAI,CAACM,QAAQ,CAACoD,IAAI,CAAC,KAAK,CAAC;IAC1D;AAwJF;AAEAC,IAAAA,yBAAgB,EAAC9D,gBAAgB;MAEjC,WAAeA"}
@@ -1,4 +0,0 @@
1
- "use strict";
2
- module.exports = FallbackModuleFactory;
3
-
4
- //# sourceMappingURL=FallbackModuleFactory.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/FallbackModuleFactory.d.ts"],"sourcesContent":["export = FallbackModuleFactory;\ndeclare class FallbackModuleFactory extends ModuleFactory {}\ndeclare namespace FallbackModuleFactory {\n export { ModuleFactoryCreateData, ModuleFactoryResult, FallbackDependency };\n}\nimport ModuleFactory = require('webpack/lib/ModuleFactory');\ntype ModuleFactoryCreateData =\n import('webpack/lib/ModuleFactory').ModuleFactoryCreateData;\ntype ModuleFactoryResult =\n import('webpack/lib/ModuleFactory').ModuleFactoryResult;\ntype FallbackDependency = import('./FallbackDependency');\n"],"names":["FallbackModuleFactory"],"mappings":";iBAASA"}
@@ -1,10 +0,0 @@
1
- import { ModuleFactoryCreateData, ModuleFactoryResult } from 'webpack/lib/ModuleFactory';
2
- import ModuleFactory from '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;
10
- }
@@ -1,35 +0,0 @@
1
- /*
2
- MIT License http://www.opensource.org/licenses/mit-license.php
3
- Author Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy, Marais Rossouw @maraisr
4
- */ 'use strict';
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- Object.defineProperty(exports, "default", {
9
- enumerable: true,
10
- get: function() {
11
- return FallbackModuleFactory;
12
- }
13
- });
14
- const _ModuleFactory = /*#__PURE__*/ _interop_require_default(require("webpack/lib/ModuleFactory"));
15
- const _FallbackModule = /*#__PURE__*/ _interop_require_default(require("./FallbackModule"));
16
- function _interop_require_default(obj) {
17
- return obj && obj.__esModule ? obj : {
18
- default: obj
19
- };
20
- }
21
- var FallbackModuleFactory;
22
- FallbackModuleFactory = class FallbackModuleFactory extends _ModuleFactory.default {
23
- /**
24
- * @param {ModuleFactoryCreateData} data data object
25
- * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback
26
- * @returns {void}
27
- */ create(data, callback) {
28
- const dependency = data.dependencies[0];
29
- callback(null, {
30
- module: new _FallbackModule.default(dependency.requests)
31
- });
32
- }
33
- };
34
-
35
- //# sourceMappingURL=FallbackModuleFactory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/FallbackModuleFactory.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy, Marais Rossouw @maraisr\n*/\n\n'use strict';\nimport {\n ModuleFactoryCreateData,\n ModuleFactoryResult,\n} from 'webpack/lib/ModuleFactory';\nimport ModuleFactory from 'webpack/lib/ModuleFactory';\nimport FallbackModule from './FallbackModule';\nimport FallbackDependency from './FallbackDependency';\n\nexport default class FallbackModuleFactory extends ModuleFactory {\n /**\n * @param {ModuleFactoryCreateData} data data object\n * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback\n * @returns {void}\n */\n override create(\n data: ModuleFactoryCreateData,\n callback: (error: Error | null, result?: ModuleFactoryResult) => void,\n ): void {\n const dependency = data.dependencies[0] as FallbackDependency;\n callback(null, {\n module: new FallbackModule(dependency.requests),\n });\n }\n}\n"],"names":["FallbackModuleFactory","ModuleFactory","create","data","callback","dependency","dependencies","module","FallbackModule","requests"],"mappings":"AAAA;;;AAGA,GAEA;;;;;;;eASqBA;;;sEAJK;uEACC;;;;;;IAGNA;AAAAA,wBAAN,MAAMA,8BAA8BC,sBAAa;IAC9D;;;;GAIC,GACD,AAASC,OACPC,IAA6B,EAC7BC,QAAqE,EAC/D;QACN,MAAMC,aAAaF,KAAKG,YAAY,CAAC,EAAE;QACvCF,SAAS,MAAM;YACbG,QAAQ,IAAIC,uBAAc,CAACH,WAAWI,QAAQ;QAChD;IACF;AACF"}
@@ -1,19 +0,0 @@
1
- import Compiler from 'webpack/lib/Compiler';
2
- /**
3
- * @typedef {import("webpack").Compiler} Compiler
4
- * @typedef {import("webpack").Compilation} Compilation
5
- * @typedef {import("webpack").Chunk} Chunk
6
- * @typedef {import("webpack").Module} Module
7
- */
8
- /**
9
- * This class is used to hoist container references in the code.
10
- * @constructor
11
- */
12
- export declare class HoistContainerReferences {
13
- /**
14
- * @function apply
15
- * @param {Compiler} compiler The webpack compiler object
16
- */
17
- apply(compiler: Compiler): void;
18
- }
19
- export default HoistContainerReferences;
@@ -1,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- HoistContainerReferences: function() {
13
- return HoistContainerReferences;
14
- },
15
- default: function() {
16
- return _default;
17
- }
18
- });
19
- let HoistContainerReferences = class HoistContainerReferences {
20
- /**
21
- * @function apply
22
- * @param {Compiler} compiler The webpack compiler object
23
- */ apply(compiler) {
24
- // Hook into the compilation process
25
- compiler.hooks.thisCompilation.tap('HoistContainerReferences', (compilation)=>{
26
- // After chunks are optimized, perform the hoisting
27
- compilation.hooks.afterOptimizeChunks.tap('HoistContainerReferences', (chunks, chunkGroups)=>{
28
- // Create a map to store chunks by their id or name
29
- /** @type {Map<(string|number), Chunk>} */ const chunkSet = new Map();
30
- // Create a set to store external module requests
31
- /** @type {Set<Module>} */ const externalRequests = new Set();
32
- // Populate the chunkSet with chunks
33
- for (const chunk of chunks){
34
- const ident = chunk.id || chunk.name;
35
- if (ident) {
36
- chunkSet.set(ident, chunk);
37
- }
38
- }
39
- // Iterate over chunks again to handle remote modules
40
- for (const chunk of chunks){
41
- // Get iterable of remote modules for the chunk
42
- const remoteModules = compilation.chunkGraph.getChunkModulesIterableBySourceType(chunk, 'remote');
43
- if (!remoteModules) continue;
44
- // Iterate over remote modules
45
- for (const remoteModule of remoteModules){
46
- // Iterate over dependencies of the remote module
47
- for (const dep of remoteModule.dependencies){
48
- // Get the module associated with the dependency
49
- const mod = compilation.moduleGraph.getModule(dep);
50
- // If the module exists and the chunk has a runtime, add the module to externalRequests
51
- if (mod !== null && chunk.runtime) {
52
- externalRequests.add(mod);
53
- // Get the runtime chunk(s) associated with the chunk
54
- const runtimeChunk = typeof chunk.runtime === 'string' || typeof chunk.runtime === 'number' ? [
55
- chunk.runtime
56
- ] : [
57
- ...chunk.runtime
58
- ];
59
- // Iterate over runtime chunks
60
- for (const runtimeChunkId of runtimeChunk){
61
- // Get the runtime chunk from the chunkSet
62
- const runtimeChunk = chunkSet.get(runtimeChunkId);
63
- // If the runtime chunk exists, connect it with the module in the chunk graph
64
- if (runtimeChunk) {
65
- compilation.chunkGraph.connectChunkAndModule(runtimeChunk, mod);
66
- }
67
- }
68
- }
69
- }
70
- }
71
- }
72
- });
73
- });
74
- }
75
- };
76
- const _default = HoistContainerReferences;
77
-
78
- //# sourceMappingURL=HoistContainerReferencesPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/HoistContainerReferencesPlugin.ts"],"sourcesContent":["import Compiler from 'webpack/lib/Compiler';\nimport Module from 'webpack/lib/Module';\nimport Chunk from 'webpack/lib/Chunk';\nimport Compilation from 'webpack/lib/Compilation';\nimport ChunkGroup from 'webpack/lib/ChunkGroup';\n\n/**\n * @typedef {import(\"webpack\").Compiler} Compiler\n * @typedef {import(\"webpack\").Compilation} Compilation\n * @typedef {import(\"webpack\").Chunk} Chunk\n * @typedef {import(\"webpack\").Module} Module\n */\n\n/**\n * This class is used to hoist container references in the code.\n * @constructor\n */\nexport class HoistContainerReferences {\n /**\n * @function apply\n * @param {Compiler} compiler The webpack compiler object\n */\n apply(compiler: Compiler): void {\n // Hook into the compilation process\n compiler.hooks.thisCompilation.tap(\n 'HoistContainerReferences',\n (compilation: Compilation) => {\n // After chunks are optimized, perform the hoisting\n compilation.hooks.afterOptimizeChunks.tap(\n 'HoistContainerReferences',\n (chunks: Iterable<Chunk>, chunkGroups: ChunkGroup[]) => {\n // Create a map to store chunks by their id or name\n /** @type {Map<(string|number), Chunk>} */\n const chunkSet = new Map<string | number, Chunk>();\n // Create a set to store external module requests\n /** @type {Set<Module>} */\n const externalRequests = new Set<Module>();\n // Populate the chunkSet with chunks\n for (const chunk of chunks) {\n const ident = chunk.id || chunk.name;\n if (ident) {\n chunkSet.set(ident, chunk);\n }\n }\n // Iterate over chunks again to handle remote modules\n for (const chunk of chunks) {\n // Get iterable of remote modules for the chunk\n const remoteModules =\n compilation.chunkGraph.getChunkModulesIterableBySourceType(\n chunk,\n 'remote',\n );\n if (!remoteModules) continue;\n // Iterate over remote modules\n for (const remoteModule of remoteModules) {\n // Iterate over dependencies of the remote module\n for (const dep of remoteModule.dependencies) {\n // Get the module associated with the dependency\n const mod = compilation.moduleGraph.getModule(dep);\n // If the module exists and the chunk has a runtime, add the module to externalRequests\n if (mod !== null && chunk.runtime) {\n externalRequests.add(mod);\n // Get the runtime chunk(s) associated with the chunk\n const runtimeChunk =\n typeof chunk.runtime === 'string' ||\n typeof chunk.runtime === 'number'\n ? [chunk.runtime]\n : [...chunk.runtime];\n // Iterate over runtime chunks\n for (const runtimeChunkId of runtimeChunk) {\n // Get the runtime chunk from the chunkSet\n const runtimeChunk = chunkSet.get(runtimeChunkId);\n // If the runtime chunk exists, connect it with the module in the chunk graph\n if (runtimeChunk) {\n compilation.chunkGraph.connectChunkAndModule(\n runtimeChunk,\n mod,\n );\n }\n }\n }\n }\n }\n }\n },\n );\n },\n );\n }\n}\nexport default HoistContainerReferences;\n"],"names":["HoistContainerReferences","apply","compiler","hooks","thisCompilation","tap","compilation","afterOptimizeChunks","chunks","chunkGroups","chunkSet","Map","externalRequests","Set","chunk","ident","id","name","set","remoteModules","chunkGraph","getChunkModulesIterableBySourceType","remoteModule","dep","dependencies","mod","moduleGraph","getModule","runtime","add","runtimeChunk","runtimeChunkId","get","connectChunkAndModule"],"mappings":";;;;;;;;;;;IAiBaA,wBAAwB;eAAxBA;;IAyEb,OAAwC;eAAxC;;;AAzEO,IAAA,AAAMA,2BAAN,MAAMA;IACX;;;GAGC,GACDC,MAAMC,QAAkB,EAAQ;QAC9B,oCAAoC;QACpCA,SAASC,KAAK,CAACC,eAAe,CAACC,GAAG,CAChC,4BACA,CAACC;YACC,mDAAmD;YACnDA,YAAYH,KAAK,CAACI,mBAAmB,CAACF,GAAG,CACvC,4BACA,CAACG,QAAyBC;gBACxB,mDAAmD;gBACnD,wCAAwC,GACxC,MAAMC,WAAW,IAAIC;gBACrB,iDAAiD;gBACjD,wBAAwB,GACxB,MAAMC,mBAAmB,IAAIC;gBAC7B,oCAAoC;gBACpC,KAAK,MAAMC,SAASN,OAAQ;oBAC1B,MAAMO,QAAQD,MAAME,EAAE,IAAIF,MAAMG,IAAI;oBACpC,IAAIF,OAAO;wBACTL,SAASQ,GAAG,CAACH,OAAOD;oBACtB;gBACF;gBACA,qDAAqD;gBACrD,KAAK,MAAMA,SAASN,OAAQ;oBAC1B,+CAA+C;oBAC/C,MAAMW,gBACJb,YAAYc,UAAU,CAACC,mCAAmC,CACxDP,OACA;oBAEJ,IAAI,CAACK,eAAe;oBACpB,8BAA8B;oBAC9B,KAAK,MAAMG,gBAAgBH,cAAe;wBACxC,iDAAiD;wBACjD,KAAK,MAAMI,OAAOD,aAAaE,YAAY,CAAE;4BAC3C,gDAAgD;4BAChD,MAAMC,MAAMnB,YAAYoB,WAAW,CAACC,SAAS,CAACJ;4BAC9C,uFAAuF;4BACvF,IAAIE,QAAQ,QAAQX,MAAMc,OAAO,EAAE;gCACjChB,iBAAiBiB,GAAG,CAACJ;gCACrB,qDAAqD;gCACrD,MAAMK,eACJ,OAAOhB,MAAMc,OAAO,KAAK,YACzB,OAAOd,MAAMc,OAAO,KAAK,WACrB;oCAACd,MAAMc,OAAO;iCAAC,GACf;uCAAId,MAAMc,OAAO;iCAAC;gCACxB,8BAA8B;gCAC9B,KAAK,MAAMG,kBAAkBD,aAAc;oCACzC,0CAA0C;oCAC1C,MAAMA,eAAepB,SAASsB,GAAG,CAACD;oCAClC,6EAA6E;oCAC7E,IAAID,cAAc;wCAChBxB,YAAYc,UAAU,CAACa,qBAAqB,CAC1CH,cACAL;oCAEJ;gCACF;4BACF;wBACF;oBACF;gBACF;YACF;QAEJ;IAEJ;AACF;MACA,WAAezB"}
@@ -1,4 +0,0 @@
1
- "use strict";
2
- module.exports = ModuleFederationPlugin;
3
-
4
- //# sourceMappingURL=ModuleFederationPlugin.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/ModuleFederationPlugin.d.ts"],"sourcesContent":["export = ModuleFederationPlugin;\ndeclare class ModuleFederationPlugin {\n /**\n * @param {ModuleFederationPluginOptions} options options\n */\n constructor(options: any);\n _options: any;\n /**\n * Apply the plugin\n * @param {Compiler} compiler the compiler instance\n * @returns {void}\n */\n apply(compiler: Compiler): void;\n}\ndeclare namespace ModuleFederationPlugin {\n export { ExternalsType, ModuleFederationPluginOptions, Shared, Compiler };\n}\ntype Compiler = import('webpack/lib/Compiler');\ntype ExternalsType = any;\ntype ModuleFederationPluginOptions = any;\ntype Shared = any;\n"],"names":["ModuleFederationPlugin"],"mappings":";iBAASA"}
@@ -1,16 +0,0 @@
1
- import type Compiler from 'webpack/lib/Compiler';
2
- import type { ModuleFederationPluginOptions } from './ModuleFederationPluginTypes';
3
- declare class ModuleFederationPlugin {
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;
15
- }
16
- export default ModuleFederationPlugin;
@@ -1,85 +0,0 @@
1
- /*
2
- MIT License http://www.opensource.org/licenses/mit-license.php
3
- Author Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy
4
- */ 'use strict';
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- Object.defineProperty(exports, "default", {
9
- enumerable: true,
10
- get: function() {
11
- return _default;
12
- }
13
- });
14
- const _ExternalsTypecheck = /*#__PURE__*/ _interop_require_default(require("webpack/schemas/plugins/container/ExternalsType.check.js"));
15
- const _SharePlugin = /*#__PURE__*/ _interop_require_default(require("../sharing/SharePlugin"));
16
- const _createschemavalidation = /*#__PURE__*/ _interop_require_default(require("webpack/lib/util/create-schema-validation"));
17
- const _ContainerPlugin = /*#__PURE__*/ _interop_require_default(require("./ContainerPlugin"));
18
- const _ContainerReferencePlugin = /*#__PURE__*/ _interop_require_default(require("./ContainerReferencePlugin"));
19
- const _ModuleFederationPlugincheck = /*#__PURE__*/ _interop_require_default(require("webpack/schemas/plugins/container/ModuleFederationPlugin.check.js"));
20
- const _ModuleFederationPlugin = /*#__PURE__*/ _interop_require_default(require("../../schemas/container/ModuleFederationPlugin"));
21
- function _interop_require_default(obj) {
22
- return obj && obj.__esModule ? obj : {
23
- default: obj
24
- };
25
- }
26
- const validate = (0, _createschemavalidation.default)(//eslint-disable-next-line
27
- _ModuleFederationPlugincheck.default, ()=>_ModuleFederationPlugin.default, {
28
- name: 'Module Federation Plugin',
29
- baseDataPath: 'options'
30
- });
31
- let ModuleFederationPlugin = class ModuleFederationPlugin {
32
- /**
33
- * Apply the plugin
34
- * @param {Compiler} compiler the compiler instance
35
- * @returns {void}
36
- */ apply(compiler) {
37
- var _compiler_options_output_enabledLibraryTypes;
38
- const { _options: options } = this;
39
- const library = options.library || {
40
- type: 'var',
41
- name: options.name
42
- };
43
- const remoteType = options.remoteType || (options.library && (0, _ExternalsTypecheck.default)(options.library.type) ? options.library.type : 'script');
44
- if (library && !((_compiler_options_output_enabledLibraryTypes = compiler.options.output.enabledLibraryTypes) == null ? void 0 : _compiler_options_output_enabledLibraryTypes.includes(library.type))) {
45
- var _compiler_options_output_enabledLibraryTypes1;
46
- (_compiler_options_output_enabledLibraryTypes1 = compiler.options.output.enabledLibraryTypes) == null ? void 0 : _compiler_options_output_enabledLibraryTypes1.push(library.type);
47
- }
48
- compiler.hooks.afterPlugins.tap('ModuleFederationPlugin', ()=>{
49
- if (options.exposes && (Array.isArray(options.exposes) ? options.exposes.length > 0 : Object.keys(options.exposes).length > 0)) {
50
- new _ContainerPlugin.default({
51
- //@ts-ignore
52
- name: options.name,
53
- library,
54
- filename: options.filename,
55
- runtime: options.runtime,
56
- shareScope: options.shareScope,
57
- exposes: options.exposes
58
- }).apply(compiler);
59
- }
60
- if (options.remotes && (Array.isArray(options.remotes) ? options.remotes.length > 0 : Object.keys(options.remotes).length > 0)) {
61
- new _ContainerReferencePlugin.default({
62
- //@ts-ignore
63
- remoteType,
64
- shareScope: options.shareScope,
65
- remotes: options.remotes
66
- }).apply(compiler);
67
- }
68
- if (options.shared) {
69
- new _SharePlugin.default({
70
- shared: options.shared,
71
- shareScope: options.shareScope
72
- }).apply(compiler);
73
- }
74
- });
75
- }
76
- /**
77
- * @param {ModuleFederationPluginOptions} options options
78
- */ constructor(options){
79
- validate(options);
80
- this._options = options;
81
- }
82
- };
83
- const _default = ModuleFederationPlugin;
84
-
85
- //# sourceMappingURL=ModuleFederationPlugin.js.map