@module-federation/esbuild 0.0.95 → 0.0.97
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/dist/adapters/lib/collect-exports.js +151 -0
- package/dist/adapters/lib/collect-exports.mjs +87 -0
- package/dist/adapters/lib/commonjs.js +260 -0
- package/dist/adapters/lib/commonjs.mjs +209 -0
- package/dist/adapters/lib/containerPlugin.js +232 -0
- package/dist/adapters/lib/containerPlugin.mjs +182 -0
- package/dist/adapters/lib/containerReference.js +219 -0
- package/dist/adapters/lib/containerReference.mjs +154 -0
- package/dist/adapters/lib/lexer.js +184 -0
- package/dist/adapters/lib/lexer.mjs +138 -0
- package/dist/adapters/lib/linkRemotesPlugin.js +115 -0
- package/dist/adapters/lib/linkRemotesPlugin.mjs +50 -0
- package/dist/adapters/lib/manifest.js +229 -0
- package/dist/adapters/lib/manifest.mjs +168 -0
- package/dist/adapters/lib/plugin.js +339 -0
- package/dist/adapters/lib/plugin.mjs +282 -0
- package/dist/adapters/lib/react-replacements.js +81 -0
- package/dist/adapters/lib/react-replacements.mjs +35 -0
- package/dist/adapters/lib/transform.js +169 -0
- package/dist/adapters/lib/transform.mjs +120 -0
- package/dist/adapters/lib/utils.js +83 -0
- package/dist/adapters/lib/utils.mjs +33 -0
- package/dist/build.js +131 -473
- package/dist/build.mjs +13 -380
- package/dist/index.js +41 -26
- package/dist/index.mjs +4 -1
- package/dist/lib/config/configuration-context.js +70 -0
- package/dist/lib/config/configuration-context.mjs +20 -0
- package/dist/lib/config/federation-config.js +31 -0
- package/dist/lib/config/federation-config.mjs +4 -0
- package/dist/lib/config/share-utils.js +339 -0
- package/dist/lib/config/share-utils.mjs +254 -0
- package/dist/lib/config/with-native-federation.js +118 -0
- package/dist/lib/config/with-native-federation.mjs +71 -0
- package/dist/lib/core/build-adapter.js +70 -0
- package/dist/lib/core/build-adapter.mjs +18 -0
- package/dist/lib/core/createContainerTemplate.js +231 -0
- package/dist/lib/core/createContainerTemplate.mjs +185 -0
- package/dist/lib/core/default-skip-list.js +99 -0
- package/dist/lib/core/default-skip-list.mjs +47 -0
- package/dist/lib/core/federation-options.js +31 -0
- package/dist/lib/core/federation-options.mjs +4 -0
- package/dist/lib/core/get-externals.js +65 -0
- package/dist/lib/core/get-externals.mjs +19 -0
- package/dist/lib/core/load-federation-config.js +69 -0
- package/dist/lib/core/load-federation-config.mjs +20 -0
- package/dist/lib/core/write-federation-info.js +65 -0
- package/dist/lib/core/write-federation-info.mjs +16 -0
- package/dist/lib/utils/logger.js +111 -0
- package/dist/lib/utils/logger.mjs +46 -0
- package/dist/lib/utils/mapped-paths.js +94 -0
- package/dist/lib/utils/mapped-paths.mjs +46 -0
- package/dist/lib/utils/normalize.js +63 -0
- package/dist/lib/utils/normalize.mjs +17 -0
- package/dist/lib/utils/package-info.js +324 -0
- package/dist/lib/utils/package-info.mjs +265 -0
- package/dist/plugin.d.ts +1 -0
- package/dist/plugin.js +79 -1231
- package/dist/plugin.mjs +2 -1187
- package/dist/resolve/esm-resolver.mjs +15 -22
- package/package.json +2 -2
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
// The require scope
|
|
10
|
+
var __webpack_require__ = {};
|
|
11
|
+
|
|
12
|
+
/************************************************************************/
|
|
13
|
+
// webpack/runtime/define_property_getters
|
|
14
|
+
(() => {
|
|
15
|
+
__webpack_require__.d = (exports, definition) => {
|
|
16
|
+
for(var key in definition) {
|
|
17
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
18
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
})();
|
|
23
|
+
// webpack/runtime/has_own_property
|
|
24
|
+
(() => {
|
|
25
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
26
|
+
})();
|
|
27
|
+
// webpack/runtime/make_namespace_object
|
|
28
|
+
(() => {
|
|
29
|
+
// define __esModule on exports
|
|
30
|
+
__webpack_require__.r = (exports) => {
|
|
31
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
32
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
/************************************************************************/
|
|
38
|
+
var __webpack_exports__ = {};
|
|
39
|
+
// ESM COMPAT FLAG
|
|
40
|
+
__webpack_require__.r(__webpack_exports__);
|
|
41
|
+
|
|
42
|
+
// EXPORTS
|
|
43
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
44
|
+
withFederation: () => (/* binding */ withFederation)
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
;// CONCATENATED MODULE: external "../core/default-skip-list.js"
|
|
48
|
+
const default_skip_list_js_namespaceObject = require("../core/default-skip-list.js");
|
|
49
|
+
;// CONCATENATED MODULE: external "./share-utils.js"
|
|
50
|
+
const external_share_utils_js_namespaceObject = require("./share-utils.js");
|
|
51
|
+
;// CONCATENATED MODULE: external "../utils/mapped-paths.js"
|
|
52
|
+
const mapped_paths_js_namespaceObject = require("../utils/mapped-paths.js");
|
|
53
|
+
;// CONCATENATED MODULE: external "../utils/logger.js"
|
|
54
|
+
const logger_js_namespaceObject = require("../utils/logger.js");
|
|
55
|
+
;// CONCATENATED MODULE: ./src/lib/config/with-native-federation.ts
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
function withFederation(config) {
|
|
62
|
+
const skip = (0,default_skip_list_js_namespaceObject.prepareSkipList)(config.skip ?? []);
|
|
63
|
+
return {
|
|
64
|
+
name: config.name ?? '',
|
|
65
|
+
filename: config.filename ?? 'remoteEntry',
|
|
66
|
+
exposes: config.exposes ?? {},
|
|
67
|
+
remotes: config.remotes ?? {},
|
|
68
|
+
shared: normalizeShared(config, skip)
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function normalizeShared(config, skip) {
|
|
72
|
+
let result = {};
|
|
73
|
+
const shared = config.shared;
|
|
74
|
+
if (!shared) {
|
|
75
|
+
result = (0,external_share_utils_js_namespaceObject.shareAll)({
|
|
76
|
+
singleton: true,
|
|
77
|
+
strictVersion: true,
|
|
78
|
+
requiredVersion: 'auto'
|
|
79
|
+
});
|
|
80
|
+
} else {
|
|
81
|
+
result = Object.keys(shared).reduce((acc, cur)=>{
|
|
82
|
+
return {
|
|
83
|
+
...acc,
|
|
84
|
+
[cur]: {
|
|
85
|
+
requiredVersion: shared[cur].requiredVersion ?? 'auto',
|
|
86
|
+
singleton: shared[cur].singleton ?? false,
|
|
87
|
+
strictVersion: shared[cur].strictVersion ?? false,
|
|
88
|
+
version: shared[cur].version,
|
|
89
|
+
includeSecondaries: shared[cur].includeSecondaries
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}, {});
|
|
93
|
+
}
|
|
94
|
+
result = Object.keys(result).filter((key)=>!(0,default_skip_list_js_namespaceObject.isInSkipList)(key, skip)).reduce((acc, cur)=>({
|
|
95
|
+
...acc,
|
|
96
|
+
[cur]: result[cur]
|
|
97
|
+
}), {});
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
function normalizeSharedMappings(config, skip) {
|
|
101
|
+
const rootTsConfigPath = findRootTsConfigJson();
|
|
102
|
+
const paths = getMappedPaths({
|
|
103
|
+
rootTsConfigPath
|
|
104
|
+
});
|
|
105
|
+
const result = paths.filter((p)=>!isInSkipList(p.key, skip) && !p.key.includes('*'));
|
|
106
|
+
if (paths.find((p)=>p.key.includes('*'))) {
|
|
107
|
+
logger.warn('Sharing mapped paths with wildcards (*) not supported');
|
|
108
|
+
}
|
|
109
|
+
return result;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
exports.withFederation = __webpack_exports__.withFederation;
|
|
113
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
114
|
+
if(["withFederation"].indexOf(__webpack_i__) === -1) {
|
|
115
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { isInSkipList as default_skip_list_mjs_isInSkipList, prepareSkipList } from "../core/default-skip-list.mjs";
|
|
2
|
+
import { shareAll } from "./share-utils.mjs";
|
|
3
|
+
import "../utils/mapped-paths.mjs";
|
|
4
|
+
import "../utils/logger.mjs";
|
|
5
|
+
|
|
6
|
+
;// CONCATENATED MODULE: external "../core/default-skip-list.mjs"
|
|
7
|
+
|
|
8
|
+
;// CONCATENATED MODULE: external "./share-utils.mjs"
|
|
9
|
+
|
|
10
|
+
;// CONCATENATED MODULE: external "../utils/mapped-paths.mjs"
|
|
11
|
+
|
|
12
|
+
;// CONCATENATED MODULE: external "../utils/logger.mjs"
|
|
13
|
+
|
|
14
|
+
;// CONCATENATED MODULE: ./src/lib/config/with-native-federation.ts
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
function withFederation(config) {
|
|
21
|
+
const skip = prepareSkipList(config.skip ?? []);
|
|
22
|
+
return {
|
|
23
|
+
name: config.name ?? '',
|
|
24
|
+
filename: config.filename ?? 'remoteEntry',
|
|
25
|
+
exposes: config.exposes ?? {},
|
|
26
|
+
remotes: config.remotes ?? {},
|
|
27
|
+
shared: normalizeShared(config, skip)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function normalizeShared(config, skip) {
|
|
31
|
+
let result = {};
|
|
32
|
+
const shared = config.shared;
|
|
33
|
+
if (!shared) {
|
|
34
|
+
result = shareAll({
|
|
35
|
+
singleton: true,
|
|
36
|
+
strictVersion: true,
|
|
37
|
+
requiredVersion: 'auto'
|
|
38
|
+
});
|
|
39
|
+
} else {
|
|
40
|
+
result = Object.keys(shared).reduce((acc, cur)=>{
|
|
41
|
+
return {
|
|
42
|
+
...acc,
|
|
43
|
+
[cur]: {
|
|
44
|
+
requiredVersion: shared[cur].requiredVersion ?? 'auto',
|
|
45
|
+
singleton: shared[cur].singleton ?? false,
|
|
46
|
+
strictVersion: shared[cur].strictVersion ?? false,
|
|
47
|
+
version: shared[cur].version,
|
|
48
|
+
includeSecondaries: shared[cur].includeSecondaries
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}, {});
|
|
52
|
+
}
|
|
53
|
+
result = Object.keys(result).filter((key)=>!default_skip_list_mjs_isInSkipList(key, skip)).reduce((acc, cur)=>({
|
|
54
|
+
...acc,
|
|
55
|
+
[cur]: result[cur]
|
|
56
|
+
}), {});
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
function normalizeSharedMappings(config, skip) {
|
|
60
|
+
const rootTsConfigPath = findRootTsConfigJson();
|
|
61
|
+
const paths = getMappedPaths({
|
|
62
|
+
rootTsConfigPath
|
|
63
|
+
});
|
|
64
|
+
const result = paths.filter((p)=>!isInSkipList(p.key, skip) && !p.key.includes('*'));
|
|
65
|
+
if (paths.find((p)=>p.key.includes('*'))) {
|
|
66
|
+
logger.warn('Sharing mapped paths with wildcards (*) not supported');
|
|
67
|
+
}
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { withFederation };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
// The require scope
|
|
10
|
+
var __webpack_require__ = {};
|
|
11
|
+
|
|
12
|
+
/************************************************************************/
|
|
13
|
+
// webpack/runtime/define_property_getters
|
|
14
|
+
(() => {
|
|
15
|
+
__webpack_require__.d = (exports, definition) => {
|
|
16
|
+
for(var key in definition) {
|
|
17
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
18
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
})();
|
|
23
|
+
// webpack/runtime/has_own_property
|
|
24
|
+
(() => {
|
|
25
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
26
|
+
})();
|
|
27
|
+
// webpack/runtime/make_namespace_object
|
|
28
|
+
(() => {
|
|
29
|
+
// define __esModule on exports
|
|
30
|
+
__webpack_require__.r = (exports) => {
|
|
31
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
32
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
/************************************************************************/
|
|
38
|
+
var __webpack_exports__ = {};
|
|
39
|
+
// ESM COMPAT FLAG
|
|
40
|
+
__webpack_require__.r(__webpack_exports__);
|
|
41
|
+
|
|
42
|
+
// EXPORTS
|
|
43
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
44
|
+
getBuildAdapter: () => (/* binding */ getBuildAdapter),
|
|
45
|
+
setBuildAdapter: () => (/* binding */ setBuildAdapter)
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
;// CONCATENATED MODULE: external "../utils/logger.js"
|
|
49
|
+
const logger_js_namespaceObject = require("../utils/logger.js");
|
|
50
|
+
;// CONCATENATED MODULE: ./src/lib/core/build-adapter.ts
|
|
51
|
+
|
|
52
|
+
let _buildAdapter = async ()=>{
|
|
53
|
+
logger_js_namespaceObject.logger.error('Please set a BuildAdapter!');
|
|
54
|
+
return [];
|
|
55
|
+
};
|
|
56
|
+
function setBuildAdapter(buildAdapter) {
|
|
57
|
+
_buildAdapter = buildAdapter;
|
|
58
|
+
}
|
|
59
|
+
function getBuildAdapter() {
|
|
60
|
+
return _buildAdapter;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
exports.getBuildAdapter = __webpack_exports__.getBuildAdapter;
|
|
64
|
+
exports.setBuildAdapter = __webpack_exports__.setBuildAdapter;
|
|
65
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
66
|
+
if(["getBuildAdapter","setBuildAdapter"].indexOf(__webpack_i__) === -1) {
|
|
67
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { logger } from "../utils/logger.mjs";
|
|
2
|
+
|
|
3
|
+
;// CONCATENATED MODULE: external "../utils/logger.mjs"
|
|
4
|
+
|
|
5
|
+
;// CONCATENATED MODULE: ./src/lib/core/build-adapter.ts
|
|
6
|
+
|
|
7
|
+
let _buildAdapter = async ()=>{
|
|
8
|
+
logger.error('Please set a BuildAdapter!');
|
|
9
|
+
return [];
|
|
10
|
+
};
|
|
11
|
+
function setBuildAdapter(buildAdapter) {
|
|
12
|
+
_buildAdapter = buildAdapter;
|
|
13
|
+
}
|
|
14
|
+
function getBuildAdapter() {
|
|
15
|
+
return _buildAdapter;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { getBuildAdapter, setBuildAdapter };
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
// The require scope
|
|
10
|
+
var __webpack_require__ = {};
|
|
11
|
+
|
|
12
|
+
/************************************************************************/
|
|
13
|
+
// webpack/runtime/define_property_getters
|
|
14
|
+
(() => {
|
|
15
|
+
__webpack_require__.d = (exports, definition) => {
|
|
16
|
+
for(var key in definition) {
|
|
17
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
18
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
})();
|
|
23
|
+
// webpack/runtime/has_own_property
|
|
24
|
+
(() => {
|
|
25
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
26
|
+
})();
|
|
27
|
+
// webpack/runtime/make_namespace_object
|
|
28
|
+
(() => {
|
|
29
|
+
// define __esModule on exports
|
|
30
|
+
__webpack_require__.r = (exports) => {
|
|
31
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
32
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
/************************************************************************/
|
|
38
|
+
var __webpack_exports__ = {};
|
|
39
|
+
__webpack_require__.r(__webpack_exports__);
|
|
40
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
41
|
+
createContainerCode: () => (createContainerCode)
|
|
42
|
+
});
|
|
43
|
+
const createContainerCode = `
|
|
44
|
+
import bundler_runtime_base from '@module-federation/webpack-bundler-runtime';
|
|
45
|
+
// import instantiatePatch from "./federation.js";
|
|
46
|
+
|
|
47
|
+
const createContainer = (federationOptions) => {
|
|
48
|
+
// await instantiatePatch(federationOptions, true);
|
|
49
|
+
const {exposes, name, remotes = [], shared, plugins} = federationOptions;
|
|
50
|
+
|
|
51
|
+
const __webpack_modules__ = {
|
|
52
|
+
"./node_modules/.federation/entry.1f2288102e035e2ed66b2efaf60ad043.js": (module, __webpack_exports__, __webpack_require__) => {
|
|
53
|
+
__webpack_require__.r(__webpack_exports__);
|
|
54
|
+
const bundler_runtime = __webpack_require__.n(bundler_runtime_base);
|
|
55
|
+
const prevFederation = __webpack_require__.federation;
|
|
56
|
+
__webpack_require__.federation = {};
|
|
57
|
+
for (const key in bundler_runtime()) {
|
|
58
|
+
__webpack_require__.federation[key] = bundler_runtime()[key];
|
|
59
|
+
}
|
|
60
|
+
for (const key in prevFederation) {
|
|
61
|
+
__webpack_require__.federation[key] = prevFederation[key];
|
|
62
|
+
}
|
|
63
|
+
if (!__webpack_require__.federation.instance) {
|
|
64
|
+
const pluginsToAdd = plugins || [];
|
|
65
|
+
__webpack_require__.federation.initOptions.plugins = __webpack_require__.federation.initOptions.plugins ?
|
|
66
|
+
__webpack_require__.federation.initOptions.plugins.concat(pluginsToAdd) : pluginsToAdd;
|
|
67
|
+
__webpack_require__.federation.instance = __webpack_require__.federation.runtime.init(__webpack_require__.federation.initOptions);
|
|
68
|
+
if (__webpack_require__.federation.attachShareScopeMap) {
|
|
69
|
+
__webpack_require__.federation.attachShareScopeMap(__webpack_require__);
|
|
70
|
+
}
|
|
71
|
+
if (__webpack_require__.federation.installInitialConsumes) {
|
|
72
|
+
__webpack_require__.federation.installInitialConsumes();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
"webpack/container/entry/createContainer": (module, exports, __webpack_require__) => {
|
|
78
|
+
const moduleMap = {};
|
|
79
|
+
for (const key in exposes) {
|
|
80
|
+
if (Object.prototype.hasOwnProperty.call(exposes, key)) {
|
|
81
|
+
moduleMap[key] = () => Promise.resolve(exposes[key]()).then(m => () => m);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const get = (module, getScope) => {
|
|
86
|
+
__webpack_require__.R = getScope;
|
|
87
|
+
getScope = (
|
|
88
|
+
__webpack_require__.o(moduleMap, module)
|
|
89
|
+
? moduleMap[module]()
|
|
90
|
+
: Promise.resolve().then(() => {
|
|
91
|
+
throw new Error("Module '" + module + "' does not exist in container.");
|
|
92
|
+
})
|
|
93
|
+
);
|
|
94
|
+
__webpack_require__.R = undefined;
|
|
95
|
+
return getScope;
|
|
96
|
+
};
|
|
97
|
+
const init = (shareScope, initScope, remoteEntryInitOptions) => {
|
|
98
|
+
return __webpack_require__.federation.bundlerRuntime.initContainerEntry({
|
|
99
|
+
webpackRequire: __webpack_require__,
|
|
100
|
+
shareScope: shareScope,
|
|
101
|
+
initScope: initScope,
|
|
102
|
+
remoteEntryInitOptions: remoteEntryInitOptions,
|
|
103
|
+
shareScopeKey: "default"
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
__webpack_require__("./node_modules/.federation/entry.1f2288102e035e2ed66b2efaf60ad043.js");
|
|
107
|
+
|
|
108
|
+
// This exports getters to disallow modifications
|
|
109
|
+
__webpack_require__.d(exports, {
|
|
110
|
+
get: () => get,
|
|
111
|
+
init: () => init,
|
|
112
|
+
moduleMap: () => moduleMap,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const __webpack_module_cache__ = {};
|
|
118
|
+
|
|
119
|
+
const __webpack_require__ = (moduleId) => {
|
|
120
|
+
let cachedModule = __webpack_module_cache__[moduleId];
|
|
121
|
+
if (cachedModule !== undefined) {
|
|
122
|
+
return cachedModule.exports;
|
|
123
|
+
}
|
|
124
|
+
let module = __webpack_module_cache__[moduleId] = {
|
|
125
|
+
id: moduleId,
|
|
126
|
+
loaded: false,
|
|
127
|
+
exports: {}
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const execOptions = {
|
|
131
|
+
id: moduleId,
|
|
132
|
+
module: module,
|
|
133
|
+
factory: __webpack_modules__[moduleId],
|
|
134
|
+
require: __webpack_require__
|
|
135
|
+
};
|
|
136
|
+
__webpack_require__.i.forEach(handler => {
|
|
137
|
+
handler(execOptions);
|
|
138
|
+
});
|
|
139
|
+
module = execOptions.module;
|
|
140
|
+
execOptions.factory.call(module.exports, module, module.exports, execOptions.require);
|
|
141
|
+
|
|
142
|
+
module.loaded = true;
|
|
143
|
+
|
|
144
|
+
return module.exports;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
__webpack_require__.m = __webpack_modules__;
|
|
148
|
+
__webpack_require__.c = __webpack_module_cache__;
|
|
149
|
+
__webpack_require__.i = [];
|
|
150
|
+
|
|
151
|
+
if (!__webpack_require__.federation) {
|
|
152
|
+
__webpack_require__.federation = {
|
|
153
|
+
initOptions: {
|
|
154
|
+
"name": name,
|
|
155
|
+
"remotes": remotes.map(remote => ({
|
|
156
|
+
"type": remote.type,
|
|
157
|
+
"alias": remote.alias,
|
|
158
|
+
"name": remote.name,
|
|
159
|
+
"entry": remote.entry,
|
|
160
|
+
"shareScope": remote.shareScope || "default"
|
|
161
|
+
}))
|
|
162
|
+
},
|
|
163
|
+
chunkMatcher: () => true,
|
|
164
|
+
rootOutputDir: "",
|
|
165
|
+
initialConsumes: undefined,
|
|
166
|
+
bundlerRuntimeOptions: {}
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
__webpack_require__.n = (module) => {
|
|
171
|
+
const getter = module && module.__esModule ? () => module['default'] : () => module;
|
|
172
|
+
__webpack_require__.d(getter, {a: getter});
|
|
173
|
+
return getter;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
__webpack_require__.d = (exports, definition) => {
|
|
177
|
+
for (const key in definition) {
|
|
178
|
+
if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
179
|
+
Object.defineProperty(exports, key, {enumerable: true, get: definition[key]});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
__webpack_require__.f = {};
|
|
185
|
+
|
|
186
|
+
__webpack_require__.g = (() => {
|
|
187
|
+
if (typeof globalThis === 'object') return globalThis;
|
|
188
|
+
try {
|
|
189
|
+
return this || new Function('return this')();
|
|
190
|
+
} catch (e) {
|
|
191
|
+
if (typeof window === 'object') return window;
|
|
192
|
+
}
|
|
193
|
+
})();
|
|
194
|
+
|
|
195
|
+
__webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
196
|
+
|
|
197
|
+
__webpack_require__.r = (exports) => {
|
|
198
|
+
if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
199
|
+
Object.defineProperty(exports, Symbol.toStringTag, {value: 'Module'});
|
|
200
|
+
}
|
|
201
|
+
Object.defineProperty(exports, '__esModule', {value: true});
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
__webpack_require__.federation.initOptions.shared = shared;
|
|
205
|
+
__webpack_require__.S = {};
|
|
206
|
+
const initPromises = {};
|
|
207
|
+
const initTokens = {};
|
|
208
|
+
__webpack_require__.I = (name, initScope) => {
|
|
209
|
+
return __webpack_require__.federation.bundlerRuntime.I({
|
|
210
|
+
shareScopeName: name,
|
|
211
|
+
webpackRequire: __webpack_require__,
|
|
212
|
+
initPromises: initPromises,
|
|
213
|
+
initTokens: initTokens,
|
|
214
|
+
initScope: initScope,
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
const __webpack_exports__ = __webpack_require__("webpack/container/entry/createContainer");
|
|
219
|
+
const __webpack_exports__get = __webpack_exports__.get;
|
|
220
|
+
const __webpack_exports__init = __webpack_exports__.init;
|
|
221
|
+
const __webpack_exports__moduleMap = __webpack_exports__.moduleMap;
|
|
222
|
+
return __webpack_exports__;
|
|
223
|
+
}`;
|
|
224
|
+
|
|
225
|
+
exports.createContainerCode = __webpack_exports__.createContainerCode;
|
|
226
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
227
|
+
if(["createContainerCode"].indexOf(__webpack_i__) === -1) {
|
|
228
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
|
|
2
|
+
;// CONCATENATED MODULE: ./src/lib/core/createContainerTemplate.ts
|
|
3
|
+
const createContainerCode = `
|
|
4
|
+
import bundler_runtime_base from '@module-federation/webpack-bundler-runtime';
|
|
5
|
+
// import instantiatePatch from "./federation.js";
|
|
6
|
+
|
|
7
|
+
const createContainer = (federationOptions) => {
|
|
8
|
+
// await instantiatePatch(federationOptions, true);
|
|
9
|
+
const {exposes, name, remotes = [], shared, plugins} = federationOptions;
|
|
10
|
+
|
|
11
|
+
const __webpack_modules__ = {
|
|
12
|
+
"./node_modules/.federation/entry.1f2288102e035e2ed66b2efaf60ad043.js": (module, __webpack_exports__, __webpack_require__) => {
|
|
13
|
+
__webpack_require__.r(__webpack_exports__);
|
|
14
|
+
const bundler_runtime = __webpack_require__.n(bundler_runtime_base);
|
|
15
|
+
const prevFederation = __webpack_require__.federation;
|
|
16
|
+
__webpack_require__.federation = {};
|
|
17
|
+
for (const key in bundler_runtime()) {
|
|
18
|
+
__webpack_require__.federation[key] = bundler_runtime()[key];
|
|
19
|
+
}
|
|
20
|
+
for (const key in prevFederation) {
|
|
21
|
+
__webpack_require__.federation[key] = prevFederation[key];
|
|
22
|
+
}
|
|
23
|
+
if (!__webpack_require__.federation.instance) {
|
|
24
|
+
const pluginsToAdd = plugins || [];
|
|
25
|
+
__webpack_require__.federation.initOptions.plugins = __webpack_require__.federation.initOptions.plugins ?
|
|
26
|
+
__webpack_require__.federation.initOptions.plugins.concat(pluginsToAdd) : pluginsToAdd;
|
|
27
|
+
__webpack_require__.federation.instance = __webpack_require__.federation.runtime.init(__webpack_require__.federation.initOptions);
|
|
28
|
+
if (__webpack_require__.federation.attachShareScopeMap) {
|
|
29
|
+
__webpack_require__.federation.attachShareScopeMap(__webpack_require__);
|
|
30
|
+
}
|
|
31
|
+
if (__webpack_require__.federation.installInitialConsumes) {
|
|
32
|
+
__webpack_require__.federation.installInitialConsumes();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
"webpack/container/entry/createContainer": (module, exports, __webpack_require__) => {
|
|
38
|
+
const moduleMap = {};
|
|
39
|
+
for (const key in exposes) {
|
|
40
|
+
if (Object.prototype.hasOwnProperty.call(exposes, key)) {
|
|
41
|
+
moduleMap[key] = () => Promise.resolve(exposes[key]()).then(m => () => m);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const get = (module, getScope) => {
|
|
46
|
+
__webpack_require__.R = getScope;
|
|
47
|
+
getScope = (
|
|
48
|
+
__webpack_require__.o(moduleMap, module)
|
|
49
|
+
? moduleMap[module]()
|
|
50
|
+
: Promise.resolve().then(() => {
|
|
51
|
+
throw new Error("Module '" + module + "' does not exist in container.");
|
|
52
|
+
})
|
|
53
|
+
);
|
|
54
|
+
__webpack_require__.R = undefined;
|
|
55
|
+
return getScope;
|
|
56
|
+
};
|
|
57
|
+
const init = (shareScope, initScope, remoteEntryInitOptions) => {
|
|
58
|
+
return __webpack_require__.federation.bundlerRuntime.initContainerEntry({
|
|
59
|
+
webpackRequire: __webpack_require__,
|
|
60
|
+
shareScope: shareScope,
|
|
61
|
+
initScope: initScope,
|
|
62
|
+
remoteEntryInitOptions: remoteEntryInitOptions,
|
|
63
|
+
shareScopeKey: "default"
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
__webpack_require__("./node_modules/.federation/entry.1f2288102e035e2ed66b2efaf60ad043.js");
|
|
67
|
+
|
|
68
|
+
// This exports getters to disallow modifications
|
|
69
|
+
__webpack_require__.d(exports, {
|
|
70
|
+
get: () => get,
|
|
71
|
+
init: () => init,
|
|
72
|
+
moduleMap: () => moduleMap,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const __webpack_module_cache__ = {};
|
|
78
|
+
|
|
79
|
+
const __webpack_require__ = (moduleId) => {
|
|
80
|
+
let cachedModule = __webpack_module_cache__[moduleId];
|
|
81
|
+
if (cachedModule !== undefined) {
|
|
82
|
+
return cachedModule.exports;
|
|
83
|
+
}
|
|
84
|
+
let module = __webpack_module_cache__[moduleId] = {
|
|
85
|
+
id: moduleId,
|
|
86
|
+
loaded: false,
|
|
87
|
+
exports: {}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const execOptions = {
|
|
91
|
+
id: moduleId,
|
|
92
|
+
module: module,
|
|
93
|
+
factory: __webpack_modules__[moduleId],
|
|
94
|
+
require: __webpack_require__
|
|
95
|
+
};
|
|
96
|
+
__webpack_require__.i.forEach(handler => {
|
|
97
|
+
handler(execOptions);
|
|
98
|
+
});
|
|
99
|
+
module = execOptions.module;
|
|
100
|
+
execOptions.factory.call(module.exports, module, module.exports, execOptions.require);
|
|
101
|
+
|
|
102
|
+
module.loaded = true;
|
|
103
|
+
|
|
104
|
+
return module.exports;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
__webpack_require__.m = __webpack_modules__;
|
|
108
|
+
__webpack_require__.c = __webpack_module_cache__;
|
|
109
|
+
__webpack_require__.i = [];
|
|
110
|
+
|
|
111
|
+
if (!__webpack_require__.federation) {
|
|
112
|
+
__webpack_require__.federation = {
|
|
113
|
+
initOptions: {
|
|
114
|
+
"name": name,
|
|
115
|
+
"remotes": remotes.map(remote => ({
|
|
116
|
+
"type": remote.type,
|
|
117
|
+
"alias": remote.alias,
|
|
118
|
+
"name": remote.name,
|
|
119
|
+
"entry": remote.entry,
|
|
120
|
+
"shareScope": remote.shareScope || "default"
|
|
121
|
+
}))
|
|
122
|
+
},
|
|
123
|
+
chunkMatcher: () => true,
|
|
124
|
+
rootOutputDir: "",
|
|
125
|
+
initialConsumes: undefined,
|
|
126
|
+
bundlerRuntimeOptions: {}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
__webpack_require__.n = (module) => {
|
|
131
|
+
const getter = module && module.__esModule ? () => module['default'] : () => module;
|
|
132
|
+
__webpack_require__.d(getter, {a: getter});
|
|
133
|
+
return getter;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
__webpack_require__.d = (exports, definition) => {
|
|
137
|
+
for (const key in definition) {
|
|
138
|
+
if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
139
|
+
Object.defineProperty(exports, key, {enumerable: true, get: definition[key]});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
__webpack_require__.f = {};
|
|
145
|
+
|
|
146
|
+
__webpack_require__.g = (() => {
|
|
147
|
+
if (typeof globalThis === 'object') return globalThis;
|
|
148
|
+
try {
|
|
149
|
+
return this || new Function('return this')();
|
|
150
|
+
} catch (e) {
|
|
151
|
+
if (typeof window === 'object') return window;
|
|
152
|
+
}
|
|
153
|
+
})();
|
|
154
|
+
|
|
155
|
+
__webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
156
|
+
|
|
157
|
+
__webpack_require__.r = (exports) => {
|
|
158
|
+
if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
159
|
+
Object.defineProperty(exports, Symbol.toStringTag, {value: 'Module'});
|
|
160
|
+
}
|
|
161
|
+
Object.defineProperty(exports, '__esModule', {value: true});
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
__webpack_require__.federation.initOptions.shared = shared;
|
|
165
|
+
__webpack_require__.S = {};
|
|
166
|
+
const initPromises = {};
|
|
167
|
+
const initTokens = {};
|
|
168
|
+
__webpack_require__.I = (name, initScope) => {
|
|
169
|
+
return __webpack_require__.federation.bundlerRuntime.I({
|
|
170
|
+
shareScopeName: name,
|
|
171
|
+
webpackRequire: __webpack_require__,
|
|
172
|
+
initPromises: initPromises,
|
|
173
|
+
initTokens: initTokens,
|
|
174
|
+
initScope: initScope,
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const __webpack_exports__ = __webpack_require__("webpack/container/entry/createContainer");
|
|
179
|
+
const __webpack_exports__get = __webpack_exports__.get;
|
|
180
|
+
const __webpack_exports__init = __webpack_exports__.init;
|
|
181
|
+
const __webpack_exports__moduleMap = __webpack_exports__.moduleMap;
|
|
182
|
+
return __webpack_exports__;
|
|
183
|
+
}`;
|
|
184
|
+
|
|
185
|
+
export { createContainerCode };
|