@module-federation/enhanced 0.2.0-canary.5 → 0.2.1
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.
- package/LICENSE +21 -0
- package/README.md +169 -0
- package/dist/package.json +85 -0
- package/dist/src/declarations/plugins/container/AsyncDependenciesBlock.d.ts +57 -0
- package/dist/src/declarations/plugins/container/Dependency.d.ts +285 -0
- package/dist/src/declarations/plugins/container/Module.d.ts +138 -0
- package/dist/src/declarations/plugins/container/ModuleFactory.d.ts +33 -0
- package/dist/src/declarations/plugins/container/ObjectDeserializerContext.d.ts +4 -0
- package/dist/src/declarations/plugins/container/StaticExportsDependency.d.ts +28 -0
- package/dist/src/declarations/plugins/container/Template.d.ts +198 -0
- package/dist/src/declarations/plugins/container/WebpackError.d.ts +32 -0
- package/dist/src/declarations/plugins/container/WebpackOptions.d.ts +140 -0
- package/dist/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.ts +74 -0
- package/dist/src/declarations/plugins/sharing/ProvideSharedPlugin.d.ts +67 -0
- package/dist/src/declarations/plugins/sharing/SharePlugin.d.ts +78 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/src/index.js +37 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib/Constants.js +125 -0
- package/dist/src/lib/Constants.js.map +1 -0
- package/dist/src/lib/RuntimeGlobals.d.ts +0 -0
- package/{src → dist/src}/lib/RuntimeGlobals.js +144 -74
- package/dist/src/lib/RuntimeGlobals.js.map +1 -0
- package/{src → dist/src}/lib/container/AsyncBoundaryPlugin.d.ts +3 -4
- package/dist/src/lib/container/AsyncBoundaryPlugin.js +198 -0
- package/dist/src/lib/container/AsyncBoundaryPlugin.js.map +1 -0
- package/dist/src/lib/container/ContainerEntryDependency.d.ts +24 -0
- package/dist/src/lib/container/ContainerEntryDependency.js +39 -0
- package/dist/src/lib/container/ContainerEntryDependency.js.map +1 -0
- package/dist/src/lib/container/ContainerEntryModule.d.ts +75 -0
- package/dist/src/lib/container/ContainerEntryModule.js +240 -0
- package/dist/src/lib/container/ContainerEntryModule.js.map +1 -0
- package/dist/src/lib/container/ContainerEntryModuleFactory.d.ts +15 -0
- package/dist/src/lib/container/ContainerEntryModuleFactory.js +30 -0
- package/dist/src/lib/container/ContainerEntryModuleFactory.js.map +1 -0
- package/dist/src/lib/container/ContainerExposedDependency.d.ts +19 -0
- package/dist/src/lib/container/ContainerExposedDependency.js +49 -0
- package/dist/src/lib/container/ContainerExposedDependency.js.map +1 -0
- package/dist/src/lib/container/ContainerPlugin.d.ts +13 -0
- package/dist/src/lib/container/ContainerPlugin.js +188 -0
- package/dist/src/lib/container/ContainerPlugin.js.map +1 -0
- package/{src → dist/src}/lib/container/ContainerReferencePlugin.d.ts +3 -3
- package/dist/src/lib/container/ContainerReferencePlugin.js +102 -0
- package/dist/src/lib/container/ContainerReferencePlugin.js.map +1 -0
- package/dist/src/lib/container/FallbackDependency.d.ts +15 -0
- package/dist/src/lib/container/FallbackDependency.js +47 -0
- package/dist/src/lib/container/FallbackDependency.js.map +1 -0
- package/dist/src/lib/container/FallbackItemDependency.d.ts +3 -0
- package/dist/src/lib/container/FallbackItemDependency.js +26 -0
- package/dist/src/lib/container/FallbackItemDependency.js.map +1 -0
- package/dist/src/lib/container/FallbackModule.d.ts +54 -0
- package/dist/src/lib/container/FallbackModule.js +152 -0
- package/dist/src/lib/container/FallbackModule.js.map +1 -0
- package/dist/src/lib/container/FallbackModuleFactory.d.ts +11 -0
- package/dist/src/lib/container/FallbackModuleFactory.js +28 -0
- package/dist/src/lib/container/FallbackModuleFactory.js.map +1 -0
- package/dist/src/lib/container/HoistContainerReferencesPlugin.d.ts +14 -0
- package/dist/src/lib/container/HoistContainerReferencesPlugin.js +64 -0
- package/dist/src/lib/container/HoistContainerReferencesPlugin.js.map +1 -0
- package/dist/src/lib/container/ModuleFederationPlugin.d.ts +17 -0
- package/dist/src/lib/container/ModuleFederationPlugin.js +133 -0
- package/dist/src/lib/container/ModuleFederationPlugin.js.map +1 -0
- package/dist/src/lib/container/RemoteModule.d.ts +90 -0
- package/dist/src/lib/container/RemoteModule.js +148 -0
- package/dist/src/lib/container/RemoteModule.js.map +1 -0
- package/dist/src/lib/container/RemoteRuntimeModule.d.ts +12 -0
- package/dist/src/lib/container/RemoteRuntimeModule.js +101 -0
- package/dist/src/lib/container/RemoteRuntimeModule.js.map +1 -0
- package/{src → dist/src}/lib/container/RemoteToExternalDependency.d.ts +3 -9
- package/dist/src/lib/container/RemoteToExternalDependency.js +26 -0
- package/dist/src/lib/container/RemoteToExternalDependency.js.map +1 -0
- package/dist/src/lib/container/constant.d.ts +3 -0
- package/dist/src/lib/container/constant.js +12 -0
- package/dist/src/lib/container/constant.js.map +1 -0
- package/{src → dist/src}/lib/container/options.d.ts +12 -4
- package/{src → dist/src}/lib/container/options.js +32 -42
- package/dist/src/lib/container/options.js.map +1 -0
- package/dist/src/lib/container/runtime/FederationRuntimeModule.d.ts +13 -0
- package/dist/src/lib/container/runtime/FederationRuntimeModule.js +49 -0
- package/dist/src/lib/container/runtime/FederationRuntimeModule.js.map +1 -0
- package/dist/src/lib/container/runtime/FederationRuntimePlugin.d.ts +17 -0
- package/dist/src/lib/container/runtime/FederationRuntimePlugin.js +209 -0
- package/dist/src/lib/container/runtime/FederationRuntimePlugin.js.map +1 -0
- package/dist/src/lib/container/runtime/RemoteEntryPlugin.d.ts +8 -0
- package/dist/src/lib/container/runtime/RemoteEntryPlugin.js +32 -0
- package/dist/src/lib/container/runtime/RemoteEntryPlugin.js.map +1 -0
- package/dist/src/lib/container/runtime/getFederationGlobal.d.ts +5 -0
- package/dist/src/lib/container/runtime/getFederationGlobal.js +26 -0
- package/dist/src/lib/container/runtime/getFederationGlobal.js.map +1 -0
- package/dist/src/lib/container/runtime/utils.d.ts +16 -0
- package/dist/src/lib/container/runtime/utils.js +83 -0
- package/dist/src/lib/container/runtime/utils.js.map +1 -0
- package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +3 -0
- package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js +26 -0
- package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js.map +1 -0
- package/dist/src/lib/sharing/ConsumeSharedModule.d.ts +99 -0
- package/dist/src/lib/sharing/ConsumeSharedModule.js +206 -0
- package/dist/src/lib/sharing/ConsumeSharedModule.js.map +1 -0
- package/dist/src/lib/sharing/ConsumeSharedPlugin.d.ts +30 -0
- package/dist/src/lib/sharing/ConsumeSharedPlugin.js +245 -0
- package/dist/src/lib/sharing/ConsumeSharedPlugin.js.map +1 -0
- package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +31 -0
- package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js +124 -0
- package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js.map +1 -0
- package/dist/src/lib/sharing/ProvideForSharedDependency.d.ts +3 -0
- package/dist/src/lib/sharing/ProvideForSharedDependency.js +27 -0
- package/dist/src/lib/sharing/ProvideForSharedDependency.js.map +1 -0
- package/dist/src/lib/sharing/ProvideSharedDependency.d.ts +36 -0
- package/dist/src/lib/sharing/ProvideSharedDependency.js +70 -0
- package/dist/src/lib/sharing/ProvideSharedDependency.js.map +1 -0
- package/dist/src/lib/sharing/ProvideSharedModule.d.ts +67 -0
- package/dist/src/lib/sharing/ProvideSharedModule.js +186 -0
- package/dist/src/lib/sharing/ProvideSharedModule.js.map +1 -0
- package/dist/src/lib/sharing/ProvideSharedModuleFactory.d.ts +18 -0
- package/dist/src/lib/sharing/ProvideSharedModuleFactory.js +30 -0
- package/dist/src/lib/sharing/ProvideSharedModuleFactory.js.map +1 -0
- package/dist/src/lib/sharing/ProvideSharedPlugin.d.ts +47 -0
- package/dist/src/lib/sharing/ProvideSharedPlugin.js +195 -0
- package/dist/src/lib/sharing/ProvideSharedPlugin.js.map +1 -0
- package/dist/src/lib/sharing/SharePlugin.d.ts +41 -0
- package/dist/src/lib/sharing/SharePlugin.js +79 -0
- package/dist/src/lib/sharing/SharePlugin.js.map +1 -0
- package/dist/src/lib/sharing/ShareRuntimeModule.d.ts +14 -0
- package/dist/src/lib/sharing/ShareRuntimeModule.js +102 -0
- package/dist/src/lib/sharing/ShareRuntimeModule.js.map +1 -0
- package/dist/src/lib/sharing/resolveMatchedConfigs.d.ts +12 -0
- package/dist/src/lib/sharing/resolveMatchedConfigs.js +66 -0
- package/dist/src/lib/sharing/resolveMatchedConfigs.js.map +1 -0
- package/dist/src/lib/sharing/utils.d.ts +37 -0
- package/{src → dist/src}/lib/sharing/utils.js +109 -81
- package/dist/src/lib/sharing/utils.js.map +1 -0
- package/dist/src/rspack.d.ts +1 -0
- package/dist/src/rspack.js +6 -0
- package/dist/src/rspack.js.map +1 -0
- package/{src → dist/src}/runtime/AddRuntimeRequirementToPromiseExternalPlugin.d.ts +1 -1
- package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js +19 -0
- package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js.map +1 -0
- package/dist/src/runtime.d.ts +1 -0
- package/dist/src/runtime.js +18 -0
- package/dist/src/runtime.js.map +1 -0
- package/dist/src/schemas/container/ContainerPlugin.check.d.ts +7 -0
- package/dist/src/schemas/container/ContainerPlugin.check.js +2318 -0
- package/dist/src/schemas/container/ContainerPlugin.check.js.map +1 -0
- package/dist/src/schemas/container/ContainerPlugin.d.ts +289 -0
- package/dist/src/schemas/container/ContainerPlugin.js +326 -0
- package/dist/src/schemas/container/ContainerPlugin.js.map +1 -0
- package/dist/src/schemas/container/ContainerReferencePlugin.check.d.ts +7 -0
- package/dist/src/schemas/container/ContainerReferencePlugin.check.js +939 -0
- package/dist/src/schemas/container/ContainerReferencePlugin.check.js.map +1 -0
- package/dist/src/schemas/container/ContainerReferencePlugin.d.ts +87 -0
- package/dist/src/schemas/container/ContainerReferencePlugin.js +132 -0
- package/dist/src/schemas/container/ContainerReferencePlugin.js.map +1 -0
- package/dist/src/schemas/container/ModuleFederationPlugin.check.d.ts +9 -0
- package/dist/src/schemas/container/ModuleFederationPlugin.check.js +4001 -0
- package/dist/src/schemas/container/ModuleFederationPlugin.check.js.map +1 -0
- package/{src → dist/src}/schemas/container/ModuleFederationPlugin.d.ts +197 -4
- package/{src → dist/src}/schemas/container/ModuleFederationPlugin.js +349 -177
- package/dist/src/schemas/container/ModuleFederationPlugin.js.map +1 -0
- package/{src/schemas/container/ModuleFederationPlugin.check.d.ts → dist/src/schemas/sharing/ProviderSharedPlugin.check.d.ts} +2 -2
- package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js +434 -0
- package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js.map +1 -0
- package/dist/src/schemas/sharing/ProviderSharedPlugin.d.ts +104 -0
- package/dist/src/schemas/sharing/ProviderSharedPlugin.js +119 -0
- package/dist/src/schemas/sharing/ProviderSharedPlugin.js.map +1 -0
- package/dist/src/types/runtime.d.ts +7 -0
- package/dist/src/types/runtime.js +3 -0
- package/dist/src/types/runtime.js.map +1 -0
- package/dist/src/webpack.d.ts +2 -0
- package/dist/src/webpack.js +9 -0
- package/dist/src/webpack.js.map +1 -0
- package/dist/src/wrapper/AsyncBoundaryPlugin.d.ts +8 -0
- package/dist/src/wrapper/AsyncBoundaryPlugin.js +19 -0
- package/dist/src/wrapper/AsyncBoundaryPlugin.js.map +1 -0
- package/dist/src/wrapper/ConsumeSharedPlugin.d.ts +8 -0
- package/dist/src/wrapper/ConsumeSharedPlugin.js +19 -0
- package/dist/src/wrapper/ConsumeSharedPlugin.js.map +1 -0
- package/dist/src/wrapper/ContainerPlugin.d.ts +8 -0
- package/dist/src/wrapper/ContainerPlugin.js +19 -0
- package/dist/src/wrapper/ContainerPlugin.js.map +1 -0
- package/dist/src/wrapper/ContainerReferencePlugin.d.ts +8 -0
- package/dist/src/wrapper/ContainerReferencePlugin.js +19 -0
- package/dist/src/wrapper/ContainerReferencePlugin.js.map +1 -0
- package/dist/src/wrapper/FederationRuntimePlugin.d.ts +9 -0
- package/dist/src/wrapper/FederationRuntimePlugin.js +22 -0
- package/dist/src/wrapper/FederationRuntimePlugin.js.map +1 -0
- package/dist/src/wrapper/HoistContainerReferencesPlugin.d.ts +7 -0
- package/dist/src/wrapper/HoistContainerReferencesPlugin.js +19 -0
- package/dist/src/wrapper/HoistContainerReferencesPlugin.js.map +1 -0
- package/dist/src/wrapper/ModuleFederationPlugin.d.ts +8 -0
- package/dist/src/wrapper/ModuleFederationPlugin.js +39 -0
- package/dist/src/wrapper/ModuleFederationPlugin.js.map +1 -0
- package/dist/src/wrapper/ProvideSharedPlugin.d.ts +8 -0
- package/dist/src/wrapper/ProvideSharedPlugin.js +19 -0
- package/dist/src/wrapper/ProvideSharedPlugin.js.map +1 -0
- package/dist/src/wrapper/SharePlugin.d.ts +8 -0
- package/dist/src/wrapper/SharePlugin.js +19 -0
- package/dist/src/wrapper/SharePlugin.js.map +1 -0
- package/package.json +75 -7
- package/global.d.js +0 -14
- package/global.d.js.map +0 -1
- package/pullts.d.ts +0 -1
- package/src/declarations/plugins/container/AsyncDependenciesBlock.d.js +0 -14
- package/src/declarations/plugins/container/AsyncDependenciesBlock.d.js.map +0 -1
- package/src/declarations/plugins/container/ContainerPlugin.d.js +0 -12
- package/src/declarations/plugins/container/ContainerPlugin.d.js.map +0 -1
- package/src/declarations/plugins/container/ContainerReferencePlugin.d.js +0 -12
- package/src/declarations/plugins/container/ContainerReferencePlugin.d.js.map +0 -1
- package/src/declarations/plugins/container/Dependency.d.js +0 -14
- package/src/declarations/plugins/container/Dependency.d.js.map +0 -1
- package/src/declarations/plugins/container/Module.d.js +0 -3
- package/src/declarations/plugins/container/Module.d.js.map +0 -1
- package/src/declarations/plugins/container/ModuleFactory.d.js +0 -3
- package/src/declarations/plugins/container/ModuleFactory.d.js.map +0 -1
- package/src/declarations/plugins/container/ModuleFederationPlugin.d.js +0 -12
- package/src/declarations/plugins/container/ModuleFederationPlugin.d.js.map +0 -1
- package/src/declarations/plugins/container/ObjectDeserializerContext.d.js +0 -6
- package/src/declarations/plugins/container/ObjectDeserializerContext.d.js.map +0 -1
- package/src/declarations/plugins/container/StaticExportsDependency.d.js +0 -14
- package/src/declarations/plugins/container/StaticExportsDependency.d.js.map +0 -1
- package/src/declarations/plugins/container/Template.d.js +0 -4
- package/src/declarations/plugins/container/Template.d.js.map +0 -1
- package/src/declarations/plugins/container/WebpackError.d.js +0 -3
- package/src/declarations/plugins/container/WebpackError.d.js.map +0 -1
- package/src/declarations/plugins/container/WebpackOptions.d.js +0 -6
- package/src/declarations/plugins/container/WebpackOptions.d.js.map +0 -1
- package/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.js +0 -12
- package/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.js.map +0 -1
- package/src/declarations/plugins/sharing/ProvideSharedPlugin.d.js +0 -12
- package/src/declarations/plugins/sharing/ProvideSharedPlugin.d.js.map +0 -1
- package/src/declarations/plugins/sharing/SharePlugin.d.js +0 -12
- package/src/declarations/plugins/sharing/SharePlugin.d.js.map +0 -1
- package/src/index.d.ts +0 -7
- package/src/index.js +0 -47
- package/src/index.js.map +0 -1
- package/src/lib/Constants.js +0 -103
- package/src/lib/Constants.js.map +0 -1
- package/src/lib/RuntimeGlobals.d.ts +0 -1
- package/src/lib/RuntimeGlobals.js.map +0 -1
- package/src/lib/container/AsyncBoundaryPlugin.js +0 -184
- package/src/lib/container/AsyncBoundaryPlugin.js.map +0 -1
- package/src/lib/container/ContainerEntryDependency.d.js +0 -4
- package/src/lib/container/ContainerEntryDependency.d.js.map +0 -1
- package/src/lib/container/ContainerEntryDependency.d.ts +0 -20
- package/src/lib/container/ContainerEntryDependency.js +0 -47
- package/src/lib/container/ContainerEntryDependency.js.map +0 -1
- package/src/lib/container/ContainerEntryModule.d.js +0 -14
- package/src/lib/container/ContainerEntryModule.d.js.map +0 -1
- package/src/lib/container/ContainerEntryModule.d.ts +0 -85
- package/src/lib/container/ContainerEntryModule.js +0 -281
- package/src/lib/container/ContainerEntryModule.js.map +0 -1
- package/src/lib/container/ContainerEntryModuleFactory.d.js +0 -4
- package/src/lib/container/ContainerEntryModuleFactory.d.js.map +0 -1
- package/src/lib/container/ContainerEntryModuleFactory.d.ts +0 -10
- package/src/lib/container/ContainerEntryModuleFactory.js +0 -37
- package/src/lib/container/ContainerEntryModuleFactory.js.map +0 -1
- package/src/lib/container/ContainerExposedDependency.d.js +0 -4
- package/src/lib/container/ContainerExposedDependency.d.js.map +0 -1
- package/src/lib/container/ContainerExposedDependency.d.ts +0 -26
- package/src/lib/container/ContainerExposedDependency.js +0 -57
- package/src/lib/container/ContainerExposedDependency.js.map +0 -1
- package/src/lib/container/ContainerPlugin.d.js +0 -4
- package/src/lib/container/ContainerPlugin.d.js.map +0 -1
- package/src/lib/container/ContainerPlugin.d.ts +0 -11
- package/src/lib/container/ContainerPlugin.js +0 -92
- package/src/lib/container/ContainerPlugin.js.map +0 -1
- package/src/lib/container/ContainerReferencePlugin.d.js +0 -4
- package/src/lib/container/ContainerReferencePlugin.d.js.map +0 -1
- package/src/lib/container/ContainerReferencePlugin.js +0 -141
- package/src/lib/container/ContainerReferencePlugin.js.map +0 -1
- package/src/lib/container/FallbackDependency.d.js +0 -14
- package/src/lib/container/FallbackDependency.d.js.map +0 -1
- package/src/lib/container/FallbackDependency.d.ts +0 -25
- package/src/lib/container/FallbackDependency.js +0 -59
- package/src/lib/container/FallbackDependency.js.map +0 -1
- package/src/lib/container/FallbackItemDependency.d.js +0 -4
- package/src/lib/container/FallbackItemDependency.d.js.map +0 -1
- package/src/lib/container/FallbackItemDependency.d.ts +0 -10
- package/src/lib/container/FallbackItemDependency.js +0 -37
- package/src/lib/container/FallbackItemDependency.js.map +0 -1
- package/src/lib/container/FallbackModule.d.js +0 -4
- package/src/lib/container/FallbackModule.d.js.map +0 -1
- package/src/lib/container/FallbackModule.d.ts +0 -73
- package/src/lib/container/FallbackModule.js +0 -153
- package/src/lib/container/FallbackModule.js.map +0 -1
- package/src/lib/container/FallbackModuleFactory.d.js +0 -4
- package/src/lib/container/FallbackModuleFactory.d.js.map +0 -1
- package/src/lib/container/FallbackModuleFactory.d.ts +0 -10
- package/src/lib/container/FallbackModuleFactory.js +0 -35
- package/src/lib/container/FallbackModuleFactory.js.map +0 -1
- package/src/lib/container/HoistContainerReferencesPlugin.d.ts +0 -19
- package/src/lib/container/HoistContainerReferencesPlugin.js +0 -78
- package/src/lib/container/HoistContainerReferencesPlugin.js.map +0 -1
- package/src/lib/container/ModuleFederationPlugin.d.js +0 -4
- package/src/lib/container/ModuleFederationPlugin.d.js.map +0 -1
- package/src/lib/container/ModuleFederationPlugin.d.ts +0 -16
- package/src/lib/container/ModuleFederationPlugin.js +0 -85
- package/src/lib/container/ModuleFederationPlugin.js.map +0 -1
- package/src/lib/container/ModuleFederationPluginTypes.d.js +0 -12
- package/src/lib/container/ModuleFederationPluginTypes.d.js.map +0 -1
- package/src/lib/container/RemoteModule.d.js +0 -13
- package/src/lib/container/RemoteModule.d.js.map +0 -1
- package/src/lib/container/RemoteModule.d.ts +0 -76
- package/src/lib/container/RemoteModule.js +0 -151
- package/src/lib/container/RemoteModule.js.map +0 -1
- package/src/lib/container/RemoteRuntimeModule.d.js +0 -13
- package/src/lib/container/RemoteRuntimeModule.d.js.map +0 -1
- package/src/lib/container/RemoteRuntimeModule.d.ts +0 -9
- package/src/lib/container/RemoteRuntimeModule.js +0 -124
- package/src/lib/container/RemoteRuntimeModule.js.map +0 -1
- package/src/lib/container/RemoteToExternalDependency.d.js +0 -19
- package/src/lib/container/RemoteToExternalDependency.d.js.map +0 -1
- package/src/lib/container/RemoteToExternalDependency.js +0 -37
- package/src/lib/container/RemoteToExternalDependency.js.map +0 -1
- package/src/lib/container/options.d.js +0 -6
- package/src/lib/container/options.d.js.map +0 -1
- package/src/lib/container/options.js.map +0 -1
- package/src/lib/inversion/ContainerInversionPlugin.d.ts +0 -1
- package/src/lib/inversion/ContainerInversionPlugin.js +0 -3
- package/src/lib/inversion/ContainerInversionPlugin.js.map +0 -1
- package/src/lib/sharing/ConsumeSharedFallbackDependency.d.js +0 -4
- package/src/lib/sharing/ConsumeSharedFallbackDependency.d.js.map +0 -1
- package/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +0 -10
- package/src/lib/sharing/ConsumeSharedFallbackDependency.js +0 -37
- package/src/lib/sharing/ConsumeSharedFallbackDependency.js.map +0 -1
- package/src/lib/sharing/ConsumeSharedModule.d.js +0 -4
- package/src/lib/sharing/ConsumeSharedModule.d.js.map +0 -1
- package/src/lib/sharing/ConsumeSharedModule.d.ts +0 -106
- package/src/lib/sharing/ConsumeSharedModule.js +0 -235
- package/src/lib/sharing/ConsumeSharedModule.js.map +0 -1
- package/src/lib/sharing/ConsumeSharedPlugin.d.js +0 -4
- package/src/lib/sharing/ConsumeSharedPlugin.d.js.map +0 -1
- package/src/lib/sharing/ConsumeSharedPlugin.d.ts +0 -8
- package/src/lib/sharing/ConsumeSharedPlugin.js +0 -274
- package/src/lib/sharing/ConsumeSharedPlugin.js.map +0 -1
- package/src/lib/sharing/ConsumeSharedRuntimeModule.d.js +0 -4
- package/src/lib/sharing/ConsumeSharedRuntimeModule.d.js.map +0 -1
- package/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +0 -13
- package/src/lib/sharing/ConsumeSharedRuntimeModule.js +0 -294
- package/src/lib/sharing/ConsumeSharedRuntimeModule.js.map +0 -1
- package/src/lib/sharing/ProvideForSharedDependency.d.js +0 -4
- package/src/lib/sharing/ProvideForSharedDependency.d.js.map +0 -1
- package/src/lib/sharing/ProvideForSharedDependency.d.ts +0 -11
- package/src/lib/sharing/ProvideForSharedDependency.js +0 -38
- package/src/lib/sharing/ProvideForSharedDependency.js.map +0 -1
- package/src/lib/sharing/ProvideSharedDependency.d.js +0 -14
- package/src/lib/sharing/ProvideSharedDependency.d.js.map +0 -1
- package/src/lib/sharing/ProvideSharedDependency.d.ts +0 -32
- package/src/lib/sharing/ProvideSharedDependency.js +0 -69
- package/src/lib/sharing/ProvideSharedDependency.js.map +0 -1
- package/src/lib/sharing/ProvideSharedModule.d.js +0 -4
- package/src/lib/sharing/ProvideSharedModule.d.js.map +0 -1
- package/src/lib/sharing/ProvideSharedModule.d.ts +0 -79
- package/src/lib/sharing/ProvideSharedModule.js +0 -203
- package/src/lib/sharing/ProvideSharedModule.js.map +0 -1
- package/src/lib/sharing/ProvideSharedModuleFactory.d.js +0 -4
- package/src/lib/sharing/ProvideSharedModuleFactory.d.js.map +0 -1
- package/src/lib/sharing/ProvideSharedModuleFactory.d.ts +0 -11
- package/src/lib/sharing/ProvideSharedModuleFactory.js +0 -36
- package/src/lib/sharing/ProvideSharedModuleFactory.js.map +0 -1
- package/src/lib/sharing/ProvideSharedPlugin.d.js +0 -4
- package/src/lib/sharing/ProvideSharedPlugin.d.js.map +0 -1
- package/src/lib/sharing/ProvideSharedPlugin.d.ts +0 -34
- package/src/lib/sharing/ProvideSharedPlugin.js +0 -182
- package/src/lib/sharing/ProvideSharedPlugin.js.map +0 -1
- package/src/lib/sharing/SharePlugin.d.js +0 -4
- package/src/lib/sharing/SharePlugin.d.js.map +0 -1
- package/src/lib/sharing/SharePlugin.d.ts +0 -15
- package/src/lib/sharing/SharePlugin.js +0 -77
- package/src/lib/sharing/SharePlugin.js.map +0 -1
- package/src/lib/sharing/ShareRuntimeModule.d.js +0 -4
- package/src/lib/sharing/ShareRuntimeModule.d.js.map +0 -1
- package/src/lib/sharing/ShareRuntimeModule.d.ts +0 -9
- package/src/lib/sharing/ShareRuntimeModule.js +0 -161
- package/src/lib/sharing/ShareRuntimeModule.js.map +0 -1
- package/src/lib/sharing/resolveMatchedConfigs.d.js +0 -6
- package/src/lib/sharing/resolveMatchedConfigs.d.js.map +0 -1
- package/src/lib/sharing/resolveMatchedConfigs.d.ts +0 -8
- package/src/lib/sharing/resolveMatchedConfigs.js +0 -73
- package/src/lib/sharing/resolveMatchedConfigs.js.map +0 -1
- package/src/lib/sharing/utils.d.js +0 -6
- package/src/lib/sharing/utils.d.js.map +0 -1
- package/src/lib/sharing/utils.d.ts +0 -33
- package/src/lib/sharing/utils.js.map +0 -1
- package/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js +0 -34
- package/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js.map +0 -1
- package/src/runtime/ModuleInfoRuntimeModule.d.ts +0 -16
- package/src/runtime/ModuleInfoRuntimeModule.js +0 -88
- package/src/runtime/ModuleInfoRuntimeModule.js.map +0 -1
- package/src/runtime/ModuleInfoRuntimePlugin.d.ts +0 -5
- package/src/runtime/ModuleInfoRuntimePlugin.js +0 -29
- package/src/runtime/ModuleInfoRuntimePlugin.js.map +0 -1
- package/src/schemas/container/ModuleFederationPlugin.check.js +0 -2245
- package/src/schemas/container/ModuleFederationPlugin.check.js.map +0 -1
- package/src/schemas/container/ModuleFederationPlugin.js.map +0 -1
- /package/{src → dist/src}/lib/Constants.d.ts +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 ScriptedAlchemy LLC (Zack Jackson) Zhou Shaw (zhouxiao)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# `@module-federation/enhanced`
|
|
2
|
+
|
|
3
|
+
This package provides enhanced features for module federation.
|
|
4
|
+
|
|
5
|
+
The following items are exported:
|
|
6
|
+
|
|
7
|
+
- ModuleFederationPlugin
|
|
8
|
+
- ContainerPlugin
|
|
9
|
+
- ContainerReferencePlugin
|
|
10
|
+
- SharePlugin
|
|
11
|
+
- ConsumeSharedPlugin
|
|
12
|
+
- ProvideSharedPlugin
|
|
13
|
+
- FederationRuntimePlugin
|
|
14
|
+
- AsyncBoundaryPlugin
|
|
15
|
+
- HoistContainerReferencesPlugin
|
|
16
|
+
|
|
17
|
+
## ModuleFederationPlugin
|
|
18
|
+
|
|
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
|
+
`shared` is used to share common dependencies between consumers and producers, reducing runtime download size and thus improving performance.
|
|
102
|
+
|
|
103
|
+
The `Shared` type is defined as follows:
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
type Shared = (SharedItem | SharedObject)[] | SharedObject;
|
|
107
|
+
|
|
108
|
+
type SharedItem = string;
|
|
109
|
+
|
|
110
|
+
interface SharedObject {
|
|
111
|
+
[k: string]: SharedConfig | SharedItem;
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### singleton
|
|
116
|
+
|
|
117
|
+
- Type: `boolean`
|
|
118
|
+
- Required: No
|
|
119
|
+
- Default: `false`
|
|
120
|
+
|
|
121
|
+
Determines whether only one version of the shared module is allowed in the shared scope (singleton mode).
|
|
122
|
+
|
|
123
|
+
- If the value is true, singleton mode is enabled; if the value is false, singleton mode is not enabled.
|
|
124
|
+
- 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:
|
|
125
|
+
- 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
|
|
126
|
+
|
|
127
|
+
#### requiredVersion
|
|
128
|
+
|
|
129
|
+
- Type: `string`
|
|
130
|
+
- Required: False
|
|
131
|
+
- Default: `require('project/package.json')[devDeps | dep]['depName']`
|
|
132
|
+
|
|
133
|
+
The required version can be a version range. The default value is the dependency version of the current application.
|
|
134
|
+
|
|
135
|
+
- 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.
|
|
136
|
+
- 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.
|
|
137
|
+
|
|
138
|
+
#### eager
|
|
139
|
+
|
|
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`.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@module-federation/enhanced",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"main": "./src/index.js",
|
|
5
|
+
"types": "./dist/src/index.d.ts",
|
|
6
|
+
"repository": "https://github.com/module-federation/core/tree/main/packages/enhanced",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist/",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"webpack": "^5.0.0",
|
|
17
|
+
"typescript": "^4.9.0 || ^5.0.0",
|
|
18
|
+
"vue-tsc": "^1.0.24"
|
|
19
|
+
},
|
|
20
|
+
"peerDependenciesMeta": {
|
|
21
|
+
"webpack": {
|
|
22
|
+
"optional": true
|
|
23
|
+
},
|
|
24
|
+
"typescript": {
|
|
25
|
+
"optional": true
|
|
26
|
+
},
|
|
27
|
+
"vue-tsc": {
|
|
28
|
+
"optional": true
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/src/index.d.ts",
|
|
34
|
+
"require": "./dist/src/index.js",
|
|
35
|
+
"import": "./dist/src/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./webpack": {
|
|
38
|
+
"types": "./dist/src/webpack.d.ts",
|
|
39
|
+
"require": "./dist/src/webpack.js",
|
|
40
|
+
"import": "./dist/src/webpack.js"
|
|
41
|
+
},
|
|
42
|
+
"./rspack": {
|
|
43
|
+
"types": "./dist/src/rspack.d.ts",
|
|
44
|
+
"require": "./dist/src/rspack.js",
|
|
45
|
+
"import": "./dist/src/rspack.js"
|
|
46
|
+
},
|
|
47
|
+
"./runtime": {
|
|
48
|
+
"types": "./dist/src/runtime.d.ts",
|
|
49
|
+
"require": "./dist/src/runtime.js",
|
|
50
|
+
"import": "./dist/src/runtime.js"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"typesVersions": {
|
|
54
|
+
"*": {
|
|
55
|
+
".": [
|
|
56
|
+
"./dist/src/index.d.ts"
|
|
57
|
+
],
|
|
58
|
+
"webpack": [
|
|
59
|
+
"./dist/src/webpack.d.ts"
|
|
60
|
+
],
|
|
61
|
+
"rspack": [
|
|
62
|
+
"./dist/src/rspack.d.ts"
|
|
63
|
+
],
|
|
64
|
+
"runtime": [
|
|
65
|
+
"./dist/src/runtime.d.ts"
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@module-federation/webpack-bundler-runtime": "workspace:*",
|
|
71
|
+
"@types/btoa": "^1.2.5"
|
|
72
|
+
},
|
|
73
|
+
"dependencies": {
|
|
74
|
+
"@module-federation/sdk": "workspace:*",
|
|
75
|
+
"@module-federation/runtime-tools": "workspace:*",
|
|
76
|
+
"@module-federation/manifest": "workspace:*",
|
|
77
|
+
"@module-federation/managers": "workspace:*",
|
|
78
|
+
"@module-federation/dts-plugin": "workspace:*",
|
|
79
|
+
"@module-federation/rspack": "workspace:*",
|
|
80
|
+
"@module-federation/bridge-react-webpack-plugin": "workspace:*",
|
|
81
|
+
"upath": "2.0.1",
|
|
82
|
+
"btoa": "^1.2.1"
|
|
83
|
+
},
|
|
84
|
+
"type": "commonjs"
|
|
85
|
+
}
|
|
@@ -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,285 @@
|
|
|
1
|
+
export class Dependency {
|
|
2
|
+
/** @type {Module | undefined} */
|
|
3
|
+
_parentModule: Module | undefined;
|
|
4
|
+
/** @type {DependenciesBlock | undefined} */
|
|
5
|
+
_parentDependenciesBlock: DependenciesBlock | undefined;
|
|
6
|
+
/** @type {number} */
|
|
7
|
+
_parentDependenciesBlockIndex: number;
|
|
8
|
+
/** @type {boolean} */
|
|
9
|
+
weak: boolean;
|
|
10
|
+
/** @type {boolean} */
|
|
11
|
+
optional: boolean;
|
|
12
|
+
_locSL: number;
|
|
13
|
+
_locSC: number;
|
|
14
|
+
_locEL: number;
|
|
15
|
+
_locEC: number;
|
|
16
|
+
_locI: any;
|
|
17
|
+
_locN: any;
|
|
18
|
+
_loc:
|
|
19
|
+
| DependencyLocation
|
|
20
|
+
| (SyntheticDependencyLocation & RealDependencyLocation)
|
|
21
|
+
| undefined;
|
|
22
|
+
/**
|
|
23
|
+
* @returns {string} a display name for the type of dependency
|
|
24
|
+
*/
|
|
25
|
+
get type(): string;
|
|
26
|
+
/**
|
|
27
|
+
* @returns {string} a dependency category, typical categories are "commonjs", "amd", "esm"
|
|
28
|
+
*/
|
|
29
|
+
get category(): string;
|
|
30
|
+
set loc(arg: DependencyLocation);
|
|
31
|
+
/**
|
|
32
|
+
* @returns {DependencyLocation} location
|
|
33
|
+
*/
|
|
34
|
+
get loc(): DependencyLocation;
|
|
35
|
+
/**
|
|
36
|
+
* @param {number} startLine start line
|
|
37
|
+
* @param {number} startColumn start column
|
|
38
|
+
* @param {number} endLine end line
|
|
39
|
+
* @param {number} endColumn end column
|
|
40
|
+
*/
|
|
41
|
+
setLoc(
|
|
42
|
+
startLine: number,
|
|
43
|
+
startColumn: number,
|
|
44
|
+
endLine: number,
|
|
45
|
+
endColumn: number,
|
|
46
|
+
): void;
|
|
47
|
+
/**
|
|
48
|
+
* @returns {string | undefined} a request context
|
|
49
|
+
*/
|
|
50
|
+
getContext(): string | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* @returns {string | null} an identifier to merge equal requests
|
|
53
|
+
*/
|
|
54
|
+
getResourceIdentifier(): string | null;
|
|
55
|
+
/**
|
|
56
|
+
* @returns {boolean | TRANSITIVE} true, when changes to the referenced module could affect the referencing module; TRANSITIVE, when changes to the referenced module could affect referencing modules of the referencing module
|
|
57
|
+
*/
|
|
58
|
+
couldAffectReferencingModule(): boolean | typeof TRANSITIVE;
|
|
59
|
+
/**
|
|
60
|
+
* Returns the referenced module and export
|
|
61
|
+
* @deprecated
|
|
62
|
+
* @param {ModuleGraph} moduleGraph module graph
|
|
63
|
+
* @returns {never} throws error
|
|
64
|
+
*/
|
|
65
|
+
getReference(moduleGraph: ModuleGraph): never;
|
|
66
|
+
/**
|
|
67
|
+
* Returns list of exports referenced by this dependency
|
|
68
|
+
* @param {ModuleGraph} moduleGraph module graph
|
|
69
|
+
* @param {RuntimeSpec} runtime the runtime for which the module is analysed
|
|
70
|
+
* @returns {(string[] | ReferencedExport)[]} referenced exports
|
|
71
|
+
*/
|
|
72
|
+
getReferencedExports(
|
|
73
|
+
moduleGraph: ModuleGraph,
|
|
74
|
+
runtime: RuntimeSpec,
|
|
75
|
+
): (string[] | ReferencedExport)[];
|
|
76
|
+
/**
|
|
77
|
+
* @param {ModuleGraph} moduleGraph module graph
|
|
78
|
+
* @returns {null | false | function(ModuleGraphConnection, RuntimeSpec): ConnectionState} function to determine if the connection is active
|
|
79
|
+
*/
|
|
80
|
+
getCondition(
|
|
81
|
+
moduleGraph: ModuleGraph,
|
|
82
|
+
):
|
|
83
|
+
| false
|
|
84
|
+
| ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState)
|
|
85
|
+
| null;
|
|
86
|
+
/**
|
|
87
|
+
* Returns the exported names
|
|
88
|
+
* @param {ModuleGraph} moduleGraph module graph
|
|
89
|
+
* @returns {ExportsSpec | undefined} export names
|
|
90
|
+
*/
|
|
91
|
+
getExports(moduleGraph: ModuleGraph): ExportsSpec | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* Returns warnings
|
|
94
|
+
* @param {ModuleGraph} moduleGraph module graph
|
|
95
|
+
* @returns {WebpackError[] | null | undefined} warnings
|
|
96
|
+
*/
|
|
97
|
+
getWarnings(moduleGraph: ModuleGraph): WebpackError[] | null | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Returns errors
|
|
100
|
+
* @param {ModuleGraph} moduleGraph module graph
|
|
101
|
+
* @returns {WebpackError[] | null | undefined} errors
|
|
102
|
+
*/
|
|
103
|
+
getErrors(moduleGraph: ModuleGraph): WebpackError[] | null | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* Update the hash
|
|
106
|
+
* @param {Hash} hash hash to be updated
|
|
107
|
+
* @param {UpdateHashContext} context context
|
|
108
|
+
* @returns {void}
|
|
109
|
+
*/
|
|
110
|
+
updateHash(hash: Hash, context: UpdateHashContext): void;
|
|
111
|
+
/**
|
|
112
|
+
* implement this method to allow the occurrence order plugin to count correctly
|
|
113
|
+
* @returns {number} count how often the id is used in this dependency
|
|
114
|
+
*/
|
|
115
|
+
getNumberOfIdOccurrences(): number;
|
|
116
|
+
/**
|
|
117
|
+
* @param {ModuleGraph} moduleGraph the module graph
|
|
118
|
+
* @returns {ConnectionState} how this dependency connects the module to referencing modules
|
|
119
|
+
*/
|
|
120
|
+
getModuleEvaluationSideEffectsState(
|
|
121
|
+
moduleGraph: ModuleGraph,
|
|
122
|
+
): ConnectionState;
|
|
123
|
+
/**
|
|
124
|
+
* @param {string} context context directory
|
|
125
|
+
* @returns {Module | null} a module
|
|
126
|
+
*/
|
|
127
|
+
createIgnoredModule(context: string): Module | null;
|
|
128
|
+
/**
|
|
129
|
+
* @param {ObjectSerializerContext} context context
|
|
130
|
+
*/
|
|
131
|
+
serialize({ write }: ObjectSerializerContext): void;
|
|
132
|
+
/**
|
|
133
|
+
* @param {ObjectDeserializerContext} context context
|
|
134
|
+
*/
|
|
135
|
+
deserialize({ read }: ObjectDeserializerContext): void;
|
|
136
|
+
set module(arg: any);
|
|
137
|
+
get module(): any;
|
|
138
|
+
get disconnect(): any;
|
|
139
|
+
}
|
|
140
|
+
declare namespace Dependency {
|
|
141
|
+
export {
|
|
142
|
+
NO_EXPORTS_REFERENCED,
|
|
143
|
+
EXPORTS_OBJECT_REFERENCED,
|
|
144
|
+
TRANSITIVE,
|
|
145
|
+
Source,
|
|
146
|
+
ChunkGraph,
|
|
147
|
+
DependenciesBlock,
|
|
148
|
+
DependencyTemplates,
|
|
149
|
+
Module,
|
|
150
|
+
ModuleGraph,
|
|
151
|
+
ModuleGraphConnection,
|
|
152
|
+
ConnectionState,
|
|
153
|
+
RuntimeTemplate,
|
|
154
|
+
WebpackError,
|
|
155
|
+
ObjectDeserializerContext,
|
|
156
|
+
ObjectSerializerContext,
|
|
157
|
+
Hash,
|
|
158
|
+
RuntimeSpec,
|
|
159
|
+
UpdateHashContext,
|
|
160
|
+
SourcePosition,
|
|
161
|
+
RealDependencyLocation,
|
|
162
|
+
SyntheticDependencyLocation,
|
|
163
|
+
DependencyLocation,
|
|
164
|
+
ExportSpec,
|
|
165
|
+
ExportsSpec,
|
|
166
|
+
ReferencedExport,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
type Module = import('./Module');
|
|
170
|
+
type DependenciesBlock = import('./DependenciesBlock');
|
|
171
|
+
type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation;
|
|
172
|
+
type SyntheticDependencyLocation = {
|
|
173
|
+
name: string;
|
|
174
|
+
index?: number | undefined;
|
|
175
|
+
};
|
|
176
|
+
type RealDependencyLocation = {
|
|
177
|
+
start: SourcePosition;
|
|
178
|
+
end?: SourcePosition | undefined;
|
|
179
|
+
index?: number | undefined;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
declare const TRANSITIVE: unique symbol;
|
|
183
|
+
type ModuleGraph = import('./ModuleGraph');
|
|
184
|
+
type RuntimeSpec = import('./util/runtime').RuntimeSpec;
|
|
185
|
+
type ReferencedExport = {
|
|
186
|
+
/**
|
|
187
|
+
* name of the referenced export
|
|
188
|
+
*/
|
|
189
|
+
name: string[];
|
|
190
|
+
/**
|
|
191
|
+
* when false, referenced export can not be mangled, defaults to true
|
|
192
|
+
*/
|
|
193
|
+
canMangle?: boolean | undefined;
|
|
194
|
+
};
|
|
195
|
+
type ModuleGraphConnection = import('./ModuleGraphConnection');
|
|
196
|
+
type ConnectionState = import('./ModuleGraphConnection').ConnectionState;
|
|
197
|
+
type ExportsSpec = {
|
|
198
|
+
/**
|
|
199
|
+
* exported names, true for unknown exports or null for no exports
|
|
200
|
+
*/
|
|
201
|
+
exports: (string | ExportSpec)[] | true | null;
|
|
202
|
+
/**
|
|
203
|
+
* when exports = true, list of unaffected exports
|
|
204
|
+
*/
|
|
205
|
+
excludeExports?: Set<string> | undefined;
|
|
206
|
+
/**
|
|
207
|
+
* list of maybe prior exposed, but now hidden exports
|
|
208
|
+
*/
|
|
209
|
+
hideExports?: Set<string> | undefined;
|
|
210
|
+
/**
|
|
211
|
+
* when reexported: from which module
|
|
212
|
+
*/
|
|
213
|
+
from?: ModuleGraphConnection | undefined;
|
|
214
|
+
/**
|
|
215
|
+
* when reexported: with which priority
|
|
216
|
+
*/
|
|
217
|
+
priority?: number | undefined;
|
|
218
|
+
/**
|
|
219
|
+
* can the export be renamed (defaults to true)
|
|
220
|
+
*/
|
|
221
|
+
canMangle?: boolean | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* are the exports terminal bindings that should be checked for export star conflicts
|
|
224
|
+
*/
|
|
225
|
+
terminalBinding?: boolean | undefined;
|
|
226
|
+
/**
|
|
227
|
+
* module on which the result depends on
|
|
228
|
+
*/
|
|
229
|
+
dependencies?: Module[] | undefined;
|
|
230
|
+
};
|
|
231
|
+
type WebpackError = import('./WebpackError');
|
|
232
|
+
type Hash = import('./util/Hash');
|
|
233
|
+
type UpdateHashContext = {
|
|
234
|
+
chunkGraph: ChunkGraph;
|
|
235
|
+
runtime: RuntimeSpec;
|
|
236
|
+
runtimeTemplate?: RuntimeTemplate | undefined;
|
|
237
|
+
};
|
|
238
|
+
type ObjectSerializerContext =
|
|
239
|
+
import('./serialization/ObjectMiddleware').ObjectSerializerContext;
|
|
240
|
+
type ObjectDeserializerContext =
|
|
241
|
+
import('./serialization/ObjectMiddleware').ObjectDeserializerContext;
|
|
242
|
+
declare const NO_EXPORTS_REFERENCED: string[][];
|
|
243
|
+
declare const EXPORTS_OBJECT_REFERENCED: string[][];
|
|
244
|
+
type Source = import('webpack-sources').Source;
|
|
245
|
+
type ChunkGraph = import('./ChunkGraph');
|
|
246
|
+
type DependencyTemplates = import('./DependencyTemplates');
|
|
247
|
+
type RuntimeTemplate = import('./RuntimeTemplate');
|
|
248
|
+
type SourcePosition = {
|
|
249
|
+
line: number;
|
|
250
|
+
column?: number | undefined;
|
|
251
|
+
};
|
|
252
|
+
type ExportSpec = {
|
|
253
|
+
/**
|
|
254
|
+
* the name of the export
|
|
255
|
+
*/
|
|
256
|
+
name: string;
|
|
257
|
+
/**
|
|
258
|
+
* can the export be renamed (defaults to true)
|
|
259
|
+
*/
|
|
260
|
+
canMangle?: boolean | undefined;
|
|
261
|
+
/**
|
|
262
|
+
* is the export a terminal binding that should be checked for export star conflicts
|
|
263
|
+
*/
|
|
264
|
+
terminalBinding?: boolean | undefined;
|
|
265
|
+
/**
|
|
266
|
+
* nested exports
|
|
267
|
+
*/
|
|
268
|
+
exports?: (string | ExportSpec)[] | undefined;
|
|
269
|
+
/**
|
|
270
|
+
* when reexported: from which module
|
|
271
|
+
*/
|
|
272
|
+
from?: ModuleGraphConnection | undefined;
|
|
273
|
+
/**
|
|
274
|
+
* when reexported: from which export
|
|
275
|
+
*/
|
|
276
|
+
export?: (string[] | null) | undefined;
|
|
277
|
+
/**
|
|
278
|
+
* when reexported: with which priority
|
|
279
|
+
*/
|
|
280
|
+
priority?: number | undefined;
|
|
281
|
+
/**
|
|
282
|
+
* export is not visible, because another export blends over it
|
|
283
|
+
*/
|
|
284
|
+
hidden?: boolean | undefined;
|
|
285
|
+
};
|