Skip to content

Commit 15eefad

Browse files
authored
Merge pull request webpack#10838 from webpack/dev-1
Merge Module Federation into webpack 5 beta
2 parents c958418 + e87ebdd commit 15eefad

File tree

137 files changed

+4322
-87
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+4322
-87
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ branches:
66
- webpack-4
77
- master
88
- next
9+
- dev-1
910

1011
cache:
1112
yarn: true

appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ branches:
66
- webpack-4
77
- master
88
- next
9+
- dev-1
910

1011
init:
1112
- git config --global core.autocrlf input

cspell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@
168168
"return'development",
169169
"datastructures",
170170
"prewalking",
171+
"overridables",
172+
"overridable",
171173

172174
"webassemblyjs",
173175
"fsevents",
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
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 =
11+
| Exposes[]
12+
| string
13+
| {
14+
[k: string]: Exposes;
15+
};
16+
/**
17+
* Add a comment in the UMD wrapper.
18+
*/
19+
export type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
20+
/**
21+
* Specify which export should be exposed as library.
22+
*/
23+
export type LibraryExport = string[] | string;
24+
/**
25+
* The name of the library (some types allow unnamed libraries too).
26+
*/
27+
export type LibraryName = string[] | string | LibraryCustomUmdObject;
28+
/**
29+
* Type of library.
30+
*/
31+
export type LibraryType =
32+
| "var"
33+
| "module"
34+
| "assign"
35+
| "this"
36+
| "window"
37+
| "self"
38+
| "global"
39+
| "commonjs"
40+
| "commonjs2"
41+
| "commonjs-module"
42+
| "amd"
43+
| "amd-require"
44+
| "umd"
45+
| "umd2"
46+
| "jsonp"
47+
| "system";
48+
/**
49+
* If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
50+
*/
51+
export type UmdNamedDefine = boolean;
52+
/**
53+
* Modules in this container that should be able to be overridden by the host. When provided, property name is used as override key, otherwise override key is automatically inferred from request.
54+
*/
55+
export type Overridables =
56+
| Overridables[]
57+
| string
58+
| {
59+
[k: string]: Overridables;
60+
};
61+
62+
export interface ContainerPluginOptions {
63+
/**
64+
* 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.
65+
*/
66+
exposes: Exposes;
67+
/**
68+
* The filename for this container relative path inside the `output.path` directory.
69+
*/
70+
filename?: string;
71+
/**
72+
* Options for library.
73+
*/
74+
library?: LibraryOptions;
75+
/**
76+
* The name for this container.
77+
*/
78+
name: string;
79+
/**
80+
* Modules in this container that should be able to be overridden by the host. When provided, property name is used as override key, otherwise override key is automatically inferred from request.
81+
*/
82+
overridables?: Overridables;
83+
}
84+
/**
85+
* Options for library.
86+
*/
87+
export interface LibraryOptions {
88+
/**
89+
* Add a comment in the UMD wrapper.
90+
*/
91+
auxiliaryComment?: AuxiliaryComment;
92+
/**
93+
* Specify which export should be exposed as library.
94+
*/
95+
export?: LibraryExport;
96+
/**
97+
* The name of the library (some types allow unnamed libraries too).
98+
*/
99+
name?: LibraryName;
100+
/**
101+
* Type of library.
102+
*/
103+
type: LibraryType;
104+
/**
105+
* If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
106+
*/
107+
umdNamedDefine?: UmdNamedDefine;
108+
}
109+
/**
110+
* Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.
111+
*/
112+
export interface LibraryCustomUmdCommentObject {
113+
/**
114+
* Set comment for `amd` section in UMD.
115+
*/
116+
amd?: string;
117+
/**
118+
* Set comment for `commonjs` (exports) section in UMD.
119+
*/
120+
commonjs?: string;
121+
/**
122+
* Set comment for `commonjs2` (module.exports) section in UMD.
123+
*/
124+
commonjs2?: string;
125+
/**
126+
* Set comment for `root` (global variable) section in UMD.
127+
*/
128+
root?: string;
129+
}
130+
/**
131+
* Description object for all UMD variants of the library name.
132+
*/
133+
export interface LibraryCustomUmdObject {
134+
/**
135+
* Name of the exposed AMD library in the UMD.
136+
*/
137+
amd?: string;
138+
/**
139+
* Name of the exposed commonjs export in the UMD.
140+
*/
141+
commonjs?: string;
142+
/**
143+
* Name of the property exposed globally by a UMD library.
144+
*/
145+
root?: string[] | string;
146+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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 in this container that should override overridable modules in the remote container. When provided, property name is used as override key, otherwise override key is automatically inferred from request.
9+
*/
10+
export type Overrides =
11+
| Overrides[]
12+
| string
13+
| {
14+
[k: string]: Overrides;
15+
};
16+
/**
17+
* Type of library.
18+
*/
19+
export type LibraryType =
20+
| "var"
21+
| "module"
22+
| "assign"
23+
| "this"
24+
| "window"
25+
| "self"
26+
| "global"
27+
| "commonjs"
28+
| "commonjs2"
29+
| "commonjs-module"
30+
| "amd"
31+
| "amd-require"
32+
| "umd"
33+
| "umd2"
34+
| "jsonp"
35+
| "system";
36+
/**
37+
* 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.
38+
*/
39+
export type Remotes =
40+
| Remotes[]
41+
| string
42+
| {
43+
[k: string]: Remotes;
44+
};
45+
46+
export interface ContainerReferencePluginOptions {
47+
/**
48+
* Modules in this container that should override overridable modules in the remote container. When provided, property name is used as override key, otherwise override key is automatically inferred from request.
49+
*/
50+
overrides?: Overrides;
51+
/**
52+
* The external type of the remote containers.
53+
*/
54+
remoteType: LibraryType;
55+
/**
56+
* 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.
57+
*/
58+
remotes: Remotes;
59+
}
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
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 =
11+
| Exposes[]
12+
| string
13+
| {
14+
[k: string]: Exposes;
15+
};
16+
/**
17+
* Add a comment in the UMD wrapper.
18+
*/
19+
export type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
20+
/**
21+
* Specify which export should be exposed as library.
22+
*/
23+
export type LibraryExport = string[] | string;
24+
/**
25+
* The name of the library (some types allow unnamed libraries too).
26+
*/
27+
export type LibraryName = string[] | string | LibraryCustomUmdObject;
28+
/**
29+
* Type of library.
30+
*/
31+
export type LibraryType =
32+
| "var"
33+
| "module"
34+
| "assign"
35+
| "this"
36+
| "window"
37+
| "self"
38+
| "global"
39+
| "commonjs"
40+
| "commonjs2"
41+
| "commonjs-module"
42+
| "amd"
43+
| "amd-require"
44+
| "umd"
45+
| "umd2"
46+
| "jsonp"
47+
| "system";
48+
/**
49+
* If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
50+
*/
51+
export type UmdNamedDefine = boolean;
52+
/**
53+
* 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.
54+
*/
55+
export type Remotes =
56+
| Remotes[]
57+
| string
58+
| {
59+
[k: string]: Remotes;
60+
};
61+
/**
62+
* Modules that should be shared with remotes and/or host. When provided, property name is used as shared key, otherwise shared key is automatically inferred from request.
63+
*/
64+
export type Shared =
65+
| Shared[]
66+
| string
67+
| {
68+
[k: string]: Shared;
69+
};
70+
71+
export interface ModuleFederationPluginOptions {
72+
/**
73+
* 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.
74+
*/
75+
exposes?: Exposes;
76+
/**
77+
* The filename of the container as relative path inside the `output.path` directory.
78+
*/
79+
filename?: string;
80+
/**
81+
* Options for library.
82+
*/
83+
library?: LibraryOptions;
84+
/**
85+
* The name of the container.
86+
*/
87+
name?: string;
88+
/**
89+
* The external type of the remote containers.
90+
*/
91+
remoteType?: LibraryType;
92+
/**
93+
* 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.
94+
*/
95+
remotes?: Remotes;
96+
/**
97+
* Modules that should be shared with remotes and/or host. When provided, property name is used as shared key, otherwise shared key is automatically inferred from request.
98+
*/
99+
shared?: Shared;
100+
}
101+
/**
102+
* Options for library.
103+
*/
104+
export interface LibraryOptions {
105+
/**
106+
* Add a comment in the UMD wrapper.
107+
*/
108+
auxiliaryComment?: AuxiliaryComment;
109+
/**
110+
* Specify which export should be exposed as library.
111+
*/
112+
export?: LibraryExport;
113+
/**
114+
* The name of the library (some types allow unnamed libraries too).
115+
*/
116+
name?: LibraryName;
117+
/**
118+
* Type of library.
119+
*/
120+
type: LibraryType;
121+
/**
122+
* If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
123+
*/
124+
umdNamedDefine?: UmdNamedDefine;
125+
}
126+
/**
127+
* Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.
128+
*/
129+
export interface LibraryCustomUmdCommentObject {
130+
/**
131+
* Set comment for `amd` section in UMD.
132+
*/
133+
amd?: string;
134+
/**
135+
* Set comment for `commonjs` (exports) section in UMD.
136+
*/
137+
commonjs?: string;
138+
/**
139+
* Set comment for `commonjs2` (module.exports) section in UMD.
140+
*/
141+
commonjs2?: string;
142+
/**
143+
* Set comment for `root` (global variable) section in UMD.
144+
*/
145+
root?: string;
146+
}
147+
/**
148+
* Description object for all UMD variants of the library name.
149+
*/
150+
export interface LibraryCustomUmdObject {
151+
/**
152+
* Name of the exposed AMD library in the UMD.
153+
*/
154+
amd?: string;
155+
/**
156+
* Name of the exposed commonjs export in the UMD.
157+
*/
158+
commonjs?: string;
159+
/**
160+
* Name of the property exposed globally by a UMD library.
161+
*/
162+
root?: string[] | string;
163+
}

0 commit comments

Comments
 (0)