-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
module-federation.config.js
37 lines (37 loc) · 1.14 KB
/
module-federation.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const auth = require('./domains/auth/auth-shell/project.json');
const grid = require('./domains/grid/ag-grid-shell/project.json');
const home = require('./domains/home/home-shell/project.json');
const shell = require('./project.json');
const apollo = [
'@apollo/client/utilities',
'@apollo/client/link/subscriptions',
'@apollo/client/link/context',
'@apollo/client/link/error',
'@apollo/client/link/core',
];
module.exports = {
name: shell.name,
remotes: [auth, grid, home].map((x) => x.name),
// (libraryName: string, sharedConfig: SharedLibraryConfig) => undefined | false | SharedLibraryConfig
shared: (libraryName, sharedConfig) => {
// We want lodash to be tree shaken, and bundled into each host/remote separately.
// if (libraryName === 'lodash') {
// return false;
// }
if (apollo.includes(libraryName)) {
return {
singleton: true,
strictVersion: false,
requiredVersion: '3.7.6',
};
}
},
additionalShared: apollo.map((libraryName) => ({
libraryName,
sharedConfig: {
singleton: true,
strictVersion: false,
requiredVersion: '3.7.6',
},
})),
};