@module-federation/enhanced 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +164 -6
- package/dist/package.json +9 -4
- package/dist/src/declarations/plugins/container/AsyncDependenciesBlock.d.ts +57 -0
- package/dist/src/declarations/plugins/container/ContainerPlugin.d.ts +187 -0
- package/dist/src/declarations/plugins/container/ContainerReferencePlugin.d.ts +80 -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/ModuleFederationPlugin.d.ts +320 -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 +12 -9
- package/dist/src/index.js +19 -14
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib/container/AsyncBoundaryPlugin.d.ts +1 -1
- package/dist/src/lib/container/AsyncBoundaryPlugin.js +3 -2
- package/dist/src/lib/container/AsyncBoundaryPlugin.js.map +1 -1
- package/dist/src/lib/container/ContainerEntryDependency.d.ts +22 -18
- package/dist/src/lib/container/ContainerEntryDependency.js +3 -1
- package/dist/src/lib/container/ContainerEntryDependency.js.map +1 -1
- package/dist/src/lib/container/ContainerEntryModule.d.ts +70 -80
- package/dist/src/lib/container/ContainerEntryModule.js +32 -12
- package/dist/src/lib/container/ContainerEntryModule.js.map +1 -1
- package/dist/src/lib/container/ContainerEntryModuleFactory.d.ts +14 -10
- package/dist/src/lib/container/ContainerEntryModuleFactory.js +2 -2
- package/dist/src/lib/container/ContainerEntryModuleFactory.js.map +1 -1
- package/dist/src/lib/container/ContainerExposedDependency.d.ts +18 -25
- package/dist/src/lib/container/ContainerPlugin.d.ts +32 -9
- package/dist/src/lib/container/ContainerPlugin.js +110 -10
- package/dist/src/lib/container/ContainerPlugin.js.map +1 -1
- package/dist/src/lib/container/ContainerReferencePlugin.d.ts +27 -12
- package/dist/src/lib/container/ContainerReferencePlugin.js +5 -3
- package/dist/src/lib/container/ContainerReferencePlugin.js.map +1 -1
- package/dist/src/lib/container/FallbackDependency.d.ts +14 -20
- package/dist/src/lib/container/FallbackItemDependency.d.ts +3 -10
- package/dist/src/lib/container/FallbackModule.d.ts +52 -70
- package/dist/src/lib/container/FallbackModule.js +2 -2
- package/dist/src/lib/container/FallbackModule.js.map +1 -1
- package/dist/src/lib/container/FallbackModuleFactory.d.ts +10 -10
- package/dist/src/lib/container/HoistContainerReferencesPlugin.d.ts +3 -4
- package/dist/src/lib/container/HoistContainerReferencesPlugin.js +33 -50
- package/dist/src/lib/container/HoistContainerReferencesPlugin.js.map +1 -1
- package/dist/src/lib/container/ModuleFederationPlugin.d.ts +21 -14
- package/dist/src/lib/container/ModuleFederationPlugin.js +19 -10
- package/dist/src/lib/container/ModuleFederationPlugin.js.map +1 -1
- package/dist/src/lib/container/ModuleFederationPluginTypes.d.ts +271 -0
- package/dist/src/lib/container/ModuleFederationPluginTypes.js +8 -0
- package/dist/src/lib/container/ModuleFederationPluginTypes.js.map +1 -0
- package/dist/src/lib/container/RemoteModule.d.ts +88 -73
- package/dist/src/lib/container/RemoteModule.js +2 -2
- package/dist/src/lib/container/RemoteModule.js.map +1 -1
- package/dist/src/lib/container/RemoteRuntimeModule.d.ts +10 -7
- package/dist/src/lib/container/RemoteRuntimeModule.js +44 -46
- package/dist/src/lib/container/RemoteRuntimeModule.js.map +1 -1
- package/dist/src/lib/container/RemoteToExternalDependency.d.ts +3 -9
- 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/dist/src/lib/container/options.d.ts +12 -4
- package/dist/src/lib/container/runtime/FederationRuntimeModule.d.ts +13 -0
- package/dist/src/lib/container/runtime/FederationRuntimeModule.js +27 -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 +199 -0
- package/dist/src/lib/container/runtime/FederationRuntimePlugin.js.map +1 -0
- package/dist/src/lib/container/runtime/getFederationGlobal.d.ts +5 -0
- package/dist/src/lib/container/runtime/getFederationGlobal.js +24 -0
- package/dist/src/lib/container/runtime/getFederationGlobal.js.map +1 -0
- package/dist/src/lib/container/runtime/utils.d.ts +15 -0
- package/dist/src/lib/container/runtime/utils.js +79 -0
- package/dist/src/lib/container/runtime/utils.js.map +1 -0
- package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +3 -10
- package/dist/src/lib/sharing/ConsumeSharedModule.d.ts +97 -104
- package/dist/src/lib/sharing/ConsumeSharedModule.js +10 -5
- package/dist/src/lib/sharing/ConsumeSharedModule.js.map +1 -1
- package/dist/src/lib/sharing/ConsumeSharedPlugin.d.ts +28 -6
- package/dist/src/lib/sharing/ConsumeSharedPlugin.js +13 -6
- package/dist/src/lib/sharing/ConsumeSharedPlugin.js.map +1 -1
- package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +29 -11
- package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js +26 -166
- package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js.map +1 -1
- package/dist/src/lib/sharing/ProvideForSharedDependency.d.ts +3 -11
- package/dist/src/lib/sharing/ProvideSharedDependency.d.ts +35 -31
- package/dist/src/lib/sharing/ProvideSharedDependency.js +11 -2
- package/dist/src/lib/sharing/ProvideSharedDependency.js.map +1 -1
- package/dist/src/lib/sharing/ProvideSharedModule.d.ts +65 -77
- package/dist/src/lib/sharing/ProvideSharedModule.js +31 -8
- package/dist/src/lib/sharing/ProvideSharedModule.js.map +1 -1
- package/dist/src/lib/sharing/ProvideSharedModuleFactory.d.ts +17 -10
- package/dist/src/lib/sharing/ProvideSharedModuleFactory.js +1 -1
- package/dist/src/lib/sharing/ProvideSharedModuleFactory.js.map +1 -1
- package/dist/src/lib/sharing/ProvideSharedPlugin.d.ts +37 -24
- package/dist/src/lib/sharing/ProvideSharedPlugin.js +12 -2
- package/dist/src/lib/sharing/ProvideSharedPlugin.js.map +1 -1
- package/dist/src/lib/sharing/SharePlugin.d.ts +39 -13
- package/dist/src/lib/sharing/SharePlugin.js +3 -0
- package/dist/src/lib/sharing/SharePlugin.js.map +1 -1
- package/dist/src/lib/sharing/ShareRuntimeModule.d.ts +12 -7
- package/dist/src/lib/sharing/ShareRuntimeModule.js +24 -51
- package/dist/src/lib/sharing/ShareRuntimeModule.js.map +1 -1
- package/dist/src/lib/sharing/resolveMatchedConfigs.d.ts +12 -8
- package/dist/src/lib/sharing/utils.d.ts +21 -17
- package/dist/src/lib/sharing/utils.js +17 -2
- package/dist/src/lib/sharing/utils.js.map +1 -1
- package/dist/src/schemas/container/ContainerPlugin.check.d.ts +7 -0
- package/dist/src/schemas/container/ContainerPlugin.check.js +2297 -0
- package/dist/src/schemas/container/ContainerPlugin.check.js.map +1 -0
- package/dist/src/schemas/container/ContainerPlugin.d.ts +268 -0
- package/dist/src/schemas/container/ContainerPlugin.js +306 -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 -7
- package/dist/src/schemas/container/ModuleFederationPlugin.check.js +3653 -1341
- package/dist/src/schemas/container/ModuleFederationPlugin.check.js.map +1 -1
- package/dist/src/schemas/container/ModuleFederationPlugin.d.ts +13 -4
- package/dist/src/schemas/container/ModuleFederationPlugin.js +13 -4
- package/dist/src/schemas/container/ModuleFederationPlugin.js.map +1 -1
- package/dist/src/schemas/sharing/ProviderSharedPlugin.check.d.ts +7 -0
- 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/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 +6 -0
- package/dist/src/wrapper/HoistContainerReferencesPlugin.js +18 -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 +24 -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 +7 -3
- package/dist/src/runtime/ModuleInfoRuntimeModule.d.ts +0 -17
- package/dist/src/runtime/ModuleInfoRuntimeModule.js +0 -80
- package/dist/src/runtime/ModuleInfoRuntimeModule.js.map +0 -1
- package/dist/src/runtime/ModuleInfoRuntimePlugin.d.ts +0 -5
- package/dist/src/runtime/ModuleInfoRuntimePlugin.js +0 -24
- package/dist/src/runtime/ModuleInfoRuntimePlugin.js.map +0 -1
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file was automatically generated.
|
|
3
|
+
* DO NOT MODIFY BY HAND.
|
|
4
|
+
* Run `yarn special-lint-fix` to update
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.
|
|
9
|
+
*/
|
|
10
|
+
export type Exposes = (ExposesItem | ExposesObject)[] | ExposesObject;
|
|
11
|
+
/**
|
|
12
|
+
* Module that should be exposed by this container.
|
|
13
|
+
*/
|
|
14
|
+
export type ExposesItem = string;
|
|
15
|
+
/**
|
|
16
|
+
* Modules that should be exposed by this container.
|
|
17
|
+
*/
|
|
18
|
+
export type ExposesItems = ExposesItem[];
|
|
19
|
+
/**
|
|
20
|
+
* Add a container for define/require functions in the AMD module.
|
|
21
|
+
*/
|
|
22
|
+
export type AmdContainer = string;
|
|
23
|
+
/**
|
|
24
|
+
* Add a comment in the UMD wrapper.
|
|
25
|
+
*/
|
|
26
|
+
export type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
|
|
27
|
+
/**
|
|
28
|
+
* Specify which export should be exposed as library.
|
|
29
|
+
*/
|
|
30
|
+
export type LibraryExport = string[] | string;
|
|
31
|
+
/**
|
|
32
|
+
* The name of the library (some types allow unnamed libraries too).
|
|
33
|
+
*/
|
|
34
|
+
export type LibraryName = string[] | string | LibraryCustomUmdObject;
|
|
35
|
+
/**
|
|
36
|
+
* Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
|
|
37
|
+
*/
|
|
38
|
+
export type LibraryType =
|
|
39
|
+
| (
|
|
40
|
+
| 'var'
|
|
41
|
+
| 'module'
|
|
42
|
+
| 'assign'
|
|
43
|
+
| 'assign-properties'
|
|
44
|
+
| 'this'
|
|
45
|
+
| 'window'
|
|
46
|
+
| 'self'
|
|
47
|
+
| 'global'
|
|
48
|
+
| 'commonjs'
|
|
49
|
+
| 'commonjs2'
|
|
50
|
+
| 'commonjs-module'
|
|
51
|
+
| 'commonjs-static'
|
|
52
|
+
| 'amd'
|
|
53
|
+
| 'amd-require'
|
|
54
|
+
| 'umd'
|
|
55
|
+
| 'umd2'
|
|
56
|
+
| 'jsonp'
|
|
57
|
+
| 'system'
|
|
58
|
+
)
|
|
59
|
+
| string;
|
|
60
|
+
/**
|
|
61
|
+
* If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
|
|
62
|
+
*/
|
|
63
|
+
export type UmdNamedDefine = boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
|
|
66
|
+
*/
|
|
67
|
+
export type ExternalsType =
|
|
68
|
+
| 'var'
|
|
69
|
+
| 'module'
|
|
70
|
+
| 'assign'
|
|
71
|
+
| 'this'
|
|
72
|
+
| 'window'
|
|
73
|
+
| 'self'
|
|
74
|
+
| 'global'
|
|
75
|
+
| 'commonjs'
|
|
76
|
+
| 'commonjs2'
|
|
77
|
+
| 'commonjs-module'
|
|
78
|
+
| 'commonjs-static'
|
|
79
|
+
| 'amd'
|
|
80
|
+
| 'amd-require'
|
|
81
|
+
| 'umd'
|
|
82
|
+
| 'umd2'
|
|
83
|
+
| 'jsonp'
|
|
84
|
+
| 'system'
|
|
85
|
+
| 'promise'
|
|
86
|
+
| 'import'
|
|
87
|
+
| 'script'
|
|
88
|
+
| 'node-commonjs';
|
|
89
|
+
/**
|
|
90
|
+
* Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.
|
|
91
|
+
*/
|
|
92
|
+
export type Remotes = (RemotesItem | RemotesObject)[] | RemotesObject;
|
|
93
|
+
/**
|
|
94
|
+
* Container location from which modules should be resolved and loaded at runtime.
|
|
95
|
+
*/
|
|
96
|
+
export type RemotesItem = string;
|
|
97
|
+
/**
|
|
98
|
+
* Container locations from which modules should be resolved and loaded at runtime.
|
|
99
|
+
*/
|
|
100
|
+
export type RemotesItems = RemotesItem[];
|
|
101
|
+
/**
|
|
102
|
+
* The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
|
|
103
|
+
*/
|
|
104
|
+
export type EntryRuntime = false | string;
|
|
105
|
+
/**
|
|
106
|
+
* Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
|
|
107
|
+
*/
|
|
108
|
+
export type Shared = (SharedItem | SharedObject)[] | SharedObject;
|
|
109
|
+
/**
|
|
110
|
+
* A module that should be shared in the share scope.
|
|
111
|
+
*/
|
|
112
|
+
export type SharedItem = string;
|
|
113
|
+
|
|
114
|
+
export interface ModuleFederationPluginOptions {
|
|
115
|
+
/**
|
|
116
|
+
* Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.
|
|
117
|
+
*/
|
|
118
|
+
exposes?: Exposes;
|
|
119
|
+
/**
|
|
120
|
+
* The filename of the container as relative path inside the `output.path` directory.
|
|
121
|
+
*/
|
|
122
|
+
filename?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Options for library.
|
|
125
|
+
*/
|
|
126
|
+
library?: LibraryOptions;
|
|
127
|
+
/**
|
|
128
|
+
* The name of the container.
|
|
129
|
+
*/
|
|
130
|
+
name?: string;
|
|
131
|
+
/**
|
|
132
|
+
* The external type of the remote containers.
|
|
133
|
+
*/
|
|
134
|
+
remoteType?: ExternalsType;
|
|
135
|
+
/**
|
|
136
|
+
* Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.
|
|
137
|
+
*/
|
|
138
|
+
remotes?: Remotes;
|
|
139
|
+
/**
|
|
140
|
+
* The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
|
|
141
|
+
*/
|
|
142
|
+
runtime?: EntryRuntime;
|
|
143
|
+
/**
|
|
144
|
+
* Share scope name used for all shared modules (defaults to 'default').
|
|
145
|
+
*/
|
|
146
|
+
shareScope?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
|
|
149
|
+
*/
|
|
150
|
+
shared?: Shared;
|
|
151
|
+
/**
|
|
152
|
+
* Runtime plugin file paths or package name.
|
|
153
|
+
*/
|
|
154
|
+
runtimePlugins?: string[];
|
|
155
|
+
/**
|
|
156
|
+
* Bundler runtime path
|
|
157
|
+
*/
|
|
158
|
+
implementation?: string;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Modules that should be exposed by this container. Property names are used as public paths.
|
|
162
|
+
*/
|
|
163
|
+
export interface ExposesObject {
|
|
164
|
+
/**
|
|
165
|
+
* Modules that should be exposed by this container.
|
|
166
|
+
*/
|
|
167
|
+
[k: string]: ExposesConfig | ExposesItem | ExposesItems;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Advanced configuration for modules that should be exposed by this container.
|
|
171
|
+
*/
|
|
172
|
+
export interface ExposesConfig {
|
|
173
|
+
/**
|
|
174
|
+
* Request to a module that should be exposed by this container.
|
|
175
|
+
*/
|
|
176
|
+
import: ExposesItem | ExposesItems;
|
|
177
|
+
/**
|
|
178
|
+
* Custom chunk name for the exposed module.
|
|
179
|
+
*/
|
|
180
|
+
name?: string;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Options for library.
|
|
184
|
+
*/
|
|
185
|
+
export interface LibraryOptions {
|
|
186
|
+
/**
|
|
187
|
+
* Add a container for define/require functions in the AMD module.
|
|
188
|
+
*/
|
|
189
|
+
amdContainer?: AmdContainer;
|
|
190
|
+
/**
|
|
191
|
+
* Add a comment in the UMD wrapper.
|
|
192
|
+
*/
|
|
193
|
+
auxiliaryComment?: AuxiliaryComment;
|
|
194
|
+
/**
|
|
195
|
+
* Specify which export should be exposed as library.
|
|
196
|
+
*/
|
|
197
|
+
export?: LibraryExport;
|
|
198
|
+
/**
|
|
199
|
+
* The name of the library (some types allow unnamed libraries too).
|
|
200
|
+
*/
|
|
201
|
+
name?: LibraryName;
|
|
202
|
+
/**
|
|
203
|
+
* Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
|
|
204
|
+
*/
|
|
205
|
+
type: LibraryType;
|
|
206
|
+
/**
|
|
207
|
+
* If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
|
|
208
|
+
*/
|
|
209
|
+
umdNamedDefine?: UmdNamedDefine;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.
|
|
213
|
+
*/
|
|
214
|
+
export interface LibraryCustomUmdCommentObject {
|
|
215
|
+
/**
|
|
216
|
+
* Set comment for `amd` section in UMD.
|
|
217
|
+
*/
|
|
218
|
+
amd?: string;
|
|
219
|
+
/**
|
|
220
|
+
* Set comment for `commonjs` (exports) section in UMD.
|
|
221
|
+
*/
|
|
222
|
+
commonjs?: string;
|
|
223
|
+
/**
|
|
224
|
+
* Set comment for `commonjs2` (module.exports) section in UMD.
|
|
225
|
+
*/
|
|
226
|
+
commonjs2?: string;
|
|
227
|
+
/**
|
|
228
|
+
* Set comment for `root` (global variable) section in UMD.
|
|
229
|
+
*/
|
|
230
|
+
root?: string;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Description object for all UMD variants of the library name.
|
|
234
|
+
*/
|
|
235
|
+
export interface LibraryCustomUmdObject {
|
|
236
|
+
/**
|
|
237
|
+
* Name of the exposed AMD library in the UMD.
|
|
238
|
+
*/
|
|
239
|
+
amd?: string;
|
|
240
|
+
/**
|
|
241
|
+
* Name of the exposed commonjs export in the UMD.
|
|
242
|
+
*/
|
|
243
|
+
commonjs?: string;
|
|
244
|
+
/**
|
|
245
|
+
* Name of the property exposed globally by a UMD library.
|
|
246
|
+
*/
|
|
247
|
+
root?: string[] | string;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.
|
|
251
|
+
*/
|
|
252
|
+
export interface RemotesObject {
|
|
253
|
+
/**
|
|
254
|
+
* Container locations from which modules should be resolved and loaded at runtime.
|
|
255
|
+
*/
|
|
256
|
+
[k: string]: RemotesConfig | RemotesItem | RemotesItems;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Advanced configuration for container locations from which modules should be resolved and loaded at runtime.
|
|
260
|
+
*/
|
|
261
|
+
export interface RemotesConfig {
|
|
262
|
+
/**
|
|
263
|
+
* Container locations from which modules should be resolved and loaded at runtime.
|
|
264
|
+
*/
|
|
265
|
+
external: RemotesItem | RemotesItems;
|
|
266
|
+
/**
|
|
267
|
+
* The name of the share scope shared with this remote.
|
|
268
|
+
*/
|
|
269
|
+
shareScope?: string;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Modules that should be shared in the share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.
|
|
273
|
+
*/
|
|
274
|
+
export interface SharedObject {
|
|
275
|
+
/**
|
|
276
|
+
* Modules that should be shared in the share scope.
|
|
277
|
+
*/
|
|
278
|
+
[k: string]: SharedConfig | SharedItem;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Advanced configuration for modules that should be shared in the share scope.
|
|
282
|
+
*/
|
|
283
|
+
export interface SharedConfig {
|
|
284
|
+
/**
|
|
285
|
+
* Include the provided and fallback module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.
|
|
286
|
+
*/
|
|
287
|
+
eager?: boolean;
|
|
288
|
+
/**
|
|
289
|
+
* Provided module that should be provided to share scope. Also acts as fallback module if no shared module is found in share scope or version isn't valid. Defaults to the property name.
|
|
290
|
+
*/
|
|
291
|
+
import?: false | SharedItem;
|
|
292
|
+
/**
|
|
293
|
+
* Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
|
|
294
|
+
*/
|
|
295
|
+
packageName?: string;
|
|
296
|
+
/**
|
|
297
|
+
* Version requirement from module in share scope.
|
|
298
|
+
*/
|
|
299
|
+
requiredVersion?: false | string;
|
|
300
|
+
/**
|
|
301
|
+
* Module is looked up under this key from the share scope.
|
|
302
|
+
*/
|
|
303
|
+
shareKey?: string;
|
|
304
|
+
/**
|
|
305
|
+
* Share scope name.
|
|
306
|
+
*/
|
|
307
|
+
shareScope?: string;
|
|
308
|
+
/**
|
|
309
|
+
* Allow only a single version of the shared module in share scope (disabled by default).
|
|
310
|
+
*/
|
|
311
|
+
singleton?: boolean;
|
|
312
|
+
/**
|
|
313
|
+
* Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).
|
|
314
|
+
*/
|
|
315
|
+
strictVersion?: boolean;
|
|
316
|
+
/**
|
|
317
|
+
* Version of the provided module. Will replace lower matching versions, but not higher.
|
|
318
|
+
*/
|
|
319
|
+
version?: false | string;
|
|
320
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export class StaticExportsDependency extends NullDependency {
|
|
2
|
+
/**
|
|
3
|
+
* @param {string[] | true} exports export names
|
|
4
|
+
* @param {boolean} canMangle true, if mangling exports names is allowed
|
|
5
|
+
*/
|
|
6
|
+
constructor(exports: string[] | true, canMangle: boolean);
|
|
7
|
+
exports: true | string[];
|
|
8
|
+
canMangle: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare namespace StaticExportsDependency {
|
|
11
|
+
export {
|
|
12
|
+
ChunkGraph,
|
|
13
|
+
ExportSpec,
|
|
14
|
+
ExportsSpec,
|
|
15
|
+
UpdateHashContext,
|
|
16
|
+
ModuleGraph,
|
|
17
|
+
ObjectDeserializerContext,
|
|
18
|
+
ObjectSerializerContext,
|
|
19
|
+
Hash,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
import NullDependency = require('./NullDependency');
|
|
23
|
+
type ChunkGraph = import('../ChunkGraph');
|
|
24
|
+
type ExportSpec = import('./Dependency').ExportSpec;
|
|
25
|
+
type ExportsSpec = import('./Dependency').ExportsSpec;
|
|
26
|
+
type UpdateHashContext = import('./Dependency').UpdateHashContext;
|
|
27
|
+
type ModuleGraph = import('../ModuleGraph');
|
|
28
|
+
type Hash = import('../util/Hash');
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
export = Template;
|
|
2
|
+
|
|
3
|
+
declare class Template {
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param {Function} fn a runtime function (.runtime.js) "template"
|
|
7
|
+
* @returns {string} the updated and normalized function string
|
|
8
|
+
*/
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
10
|
+
static getFunctionContent(fn: Function): string;
|
|
11
|
+
/**
|
|
12
|
+
* @param {string} str the string converted to identifier
|
|
13
|
+
* @returns {string} created identifier
|
|
14
|
+
*/
|
|
15
|
+
static toIdentifier(str: string): string;
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param {string} str string to be converted to commented in bundle code
|
|
19
|
+
* @returns {string} returns a commented version of string
|
|
20
|
+
*/
|
|
21
|
+
static toComment(str: string): string;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param {string} str string to be converted to "normal comment"
|
|
25
|
+
* @returns {string} returns a commented version of string
|
|
26
|
+
*/
|
|
27
|
+
static toNormalComment(str: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* @param {string} str string path to be normalized
|
|
30
|
+
* @returns {string} normalized bundle-safe path
|
|
31
|
+
*/
|
|
32
|
+
static toPath(str: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* @param {number} n number to convert to ident
|
|
35
|
+
* @returns {string} returns single character ident
|
|
36
|
+
*/
|
|
37
|
+
static numberToIdentifier(n: number): string;
|
|
38
|
+
/**
|
|
39
|
+
* @param {number} n number to convert to ident
|
|
40
|
+
* @returns {string} returns single character ident
|
|
41
|
+
*/
|
|
42
|
+
static numberToIdentifierContinuation(n: number): string;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @param {string | string[]} s string to convert to identity
|
|
46
|
+
* @returns {string} converted identity
|
|
47
|
+
*/
|
|
48
|
+
static indent(s: string | string[]): string;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @param {string|string[]} s string to create prefix for
|
|
52
|
+
* @param {string} prefix prefix to compose
|
|
53
|
+
* @returns {string} returns new prefix string
|
|
54
|
+
*/
|
|
55
|
+
static prefix(s: string | string[], prefix: string): string;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @param {string|string[]} str string or string collection
|
|
59
|
+
* @returns {string} returns a single string from array
|
|
60
|
+
*/
|
|
61
|
+
static asString(str: string | string[]): string;
|
|
62
|
+
/**
|
|
63
|
+
* @typedef {Object} WithId
|
|
64
|
+
* @property {string|number} id
|
|
65
|
+
*/
|
|
66
|
+
/**
|
|
67
|
+
* @param {WithId[]} modules a collection of modules to get array bounds for
|
|
68
|
+
* @returns {[number, number] | false} returns the upper and lower array bounds
|
|
69
|
+
* or false if not every module has a number based id
|
|
70
|
+
*/
|
|
71
|
+
static getModulesArrayBounds(
|
|
72
|
+
modules: {
|
|
73
|
+
id: string | number;
|
|
74
|
+
}[],
|
|
75
|
+
): [number, number] | false;
|
|
76
|
+
/**
|
|
77
|
+
* @param {ChunkRenderContext} renderContext render context
|
|
78
|
+
* @param {Module[]} modules modules to render (should be ordered by identifier)
|
|
79
|
+
* @param {function(Module): Source} renderModule function to render a module
|
|
80
|
+
* @param {string=} prefix applying prefix strings
|
|
81
|
+
* @returns {Source | null} rendered chunk modules in a Source object or null if no modules
|
|
82
|
+
*/
|
|
83
|
+
static renderChunkModules(
|
|
84
|
+
renderContext: ChunkRenderContext,
|
|
85
|
+
modules: Module[],
|
|
86
|
+
renderModule: (arg0: Module) => Source,
|
|
87
|
+
prefix?: string | undefined,
|
|
88
|
+
): Source | null;
|
|
89
|
+
/**
|
|
90
|
+
* @param {RuntimeModule[]} runtimeModules array of runtime modules in order
|
|
91
|
+
* @param {RenderContext & { codeGenerationResults?: CodeGenerationResults }} renderContext render context
|
|
92
|
+
* @returns {Source} rendered runtime modules in a Source object
|
|
93
|
+
*/
|
|
94
|
+
static renderRuntimeModules(
|
|
95
|
+
runtimeModules: RuntimeModule[],
|
|
96
|
+
renderContext: RenderContext & {
|
|
97
|
+
codeGenerationResults?: CodeGenerationResults;
|
|
98
|
+
},
|
|
99
|
+
): Source;
|
|
100
|
+
/**
|
|
101
|
+
* @param {RuntimeModule[]} runtimeModules array of runtime modules in order
|
|
102
|
+
* @param {RenderContext} renderContext render context
|
|
103
|
+
* @returns {Source} rendered chunk runtime modules in a Source object
|
|
104
|
+
*/
|
|
105
|
+
static renderChunkRuntimeModules(
|
|
106
|
+
runtimeModules: RuntimeModule[],
|
|
107
|
+
renderContext: RenderContext,
|
|
108
|
+
): Source;
|
|
109
|
+
}
|
|
110
|
+
declare namespace Template {
|
|
111
|
+
export {
|
|
112
|
+
NUMBER_OF_IDENTIFIER_START_CHARS,
|
|
113
|
+
NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS,
|
|
114
|
+
Source,
|
|
115
|
+
OutputOptions,
|
|
116
|
+
Chunk,
|
|
117
|
+
ChunkGraph,
|
|
118
|
+
CodeGenerationResults,
|
|
119
|
+
AssetInfo,
|
|
120
|
+
PathData,
|
|
121
|
+
DependencyTemplates,
|
|
122
|
+
Module,
|
|
123
|
+
ModuleGraph,
|
|
124
|
+
ModuleTemplate,
|
|
125
|
+
RuntimeModule,
|
|
126
|
+
RuntimeTemplate,
|
|
127
|
+
ChunkRenderContext,
|
|
128
|
+
RenderContext,
|
|
129
|
+
RenderManifestOptions,
|
|
130
|
+
RenderManifestEntry,
|
|
131
|
+
RenderManifestEntryTemplated,
|
|
132
|
+
RenderManifestEntryStatic,
|
|
133
|
+
HasId,
|
|
134
|
+
ModuleFilterPredicate,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
type ChunkRenderContext =
|
|
138
|
+
import('./javascript/JavascriptModulesPlugin').ChunkRenderContext;
|
|
139
|
+
type Module = import('./Module');
|
|
140
|
+
type Source = import('webpack-sources').Source;
|
|
141
|
+
type RuntimeModule = import('./RuntimeModule');
|
|
142
|
+
type RenderContext =
|
|
143
|
+
import('./javascript/JavascriptModulesPlugin').RenderContext;
|
|
144
|
+
type CodeGenerationResults = import('./CodeGenerationResults');
|
|
145
|
+
declare const NUMBER_OF_IDENTIFIER_START_CHARS: number;
|
|
146
|
+
declare const NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number;
|
|
147
|
+
type OutputOptions = import('../declarations/WebpackOptions').Output;
|
|
148
|
+
type Chunk = import('./Chunk');
|
|
149
|
+
type ChunkGraph = import('./ChunkGraph');
|
|
150
|
+
type AssetInfo = import('./Compilation').AssetInfo;
|
|
151
|
+
type PathData = import('./Compilation').PathData;
|
|
152
|
+
type DependencyTemplates = import('./DependencyTemplates');
|
|
153
|
+
type ModuleGraph = import('./ModuleGraph');
|
|
154
|
+
type ModuleTemplate = import('./ModuleTemplate');
|
|
155
|
+
type RuntimeTemplate = import('./RuntimeTemplate');
|
|
156
|
+
type RenderManifestOptions = {
|
|
157
|
+
/**
|
|
158
|
+
* the chunk used to render
|
|
159
|
+
*/
|
|
160
|
+
chunk: Chunk;
|
|
161
|
+
hash: string;
|
|
162
|
+
fullHash: string;
|
|
163
|
+
outputOptions: OutputOptions;
|
|
164
|
+
codeGenerationResults: CodeGenerationResults;
|
|
165
|
+
moduleTemplates: {
|
|
166
|
+
javascript: ModuleTemplate;
|
|
167
|
+
};
|
|
168
|
+
dependencyTemplates: DependencyTemplates;
|
|
169
|
+
runtimeTemplate: RuntimeTemplate;
|
|
170
|
+
moduleGraph: ModuleGraph;
|
|
171
|
+
chunkGraph: ChunkGraph;
|
|
172
|
+
};
|
|
173
|
+
type RenderManifestEntry =
|
|
174
|
+
| RenderManifestEntryTemplated
|
|
175
|
+
| RenderManifestEntryStatic;
|
|
176
|
+
type RenderManifestEntryTemplated = {
|
|
177
|
+
render: () => Source;
|
|
178
|
+
filenameTemplate:
|
|
179
|
+
| string
|
|
180
|
+
| ((arg0: PathData, arg1: AssetInfo | undefined) => string);
|
|
181
|
+
pathOptions?: PathData | undefined;
|
|
182
|
+
info?: AssetInfo | undefined;
|
|
183
|
+
identifier: string;
|
|
184
|
+
hash?: string | undefined;
|
|
185
|
+
auxiliary?: boolean | undefined;
|
|
186
|
+
};
|
|
187
|
+
type RenderManifestEntryStatic = {
|
|
188
|
+
render: () => Source;
|
|
189
|
+
filename: string;
|
|
190
|
+
info: AssetInfo;
|
|
191
|
+
identifier: string;
|
|
192
|
+
hash?: string | undefined;
|
|
193
|
+
auxiliary?: boolean | undefined;
|
|
194
|
+
};
|
|
195
|
+
type HasId = {
|
|
196
|
+
id: number | string;
|
|
197
|
+
};
|
|
198
|
+
type ModuleFilterPredicate = (arg0: Module, arg1: number) => boolean;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare class WebpackError extends Error {
|
|
2
|
+
/**
|
|
3
|
+
* Creates an instance of WebpackError.
|
|
4
|
+
*/
|
|
5
|
+
constructor(message?: string);
|
|
6
|
+
details?: string;
|
|
7
|
+
module?: null | Module;
|
|
8
|
+
loc?: SyntheticDependencyLocation | RealDependencyLocation;
|
|
9
|
+
hideStack?: boolean;
|
|
10
|
+
chunk?: Chunk;
|
|
11
|
+
file?: string;
|
|
12
|
+
serialize(__0: ObjectSerializerContext): void;
|
|
13
|
+
deserialize(__0: ObjectDeserializerContext): void;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Create .stack property on a target object
|
|
17
|
+
*/
|
|
18
|
+
static captureStackTrace(
|
|
19
|
+
targetObject: object,
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
21
|
+
constructorOpt?: Function,
|
|
22
|
+
): void;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Optional override for formatting stack traces
|
|
26
|
+
*/
|
|
27
|
+
static prepareStackTrace?: (
|
|
28
|
+
err: Error,
|
|
29
|
+
stackTraces: NodeJS.CallSite[],
|
|
30
|
+
) => any;
|
|
31
|
+
static stackTraceLimit: number;
|
|
32
|
+
}
|