@module-federation/enhanced 0.0.4-0 → 0.2.0-canary.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/package.json +2 -4
- package/src/index.js +12 -12
- package/src/index.js.map +1 -1
- package/src/lib/Constants.js +33 -33
- package/src/lib/Constants.js.map +1 -1
- package/src/lib/container/AsyncBoundaryPlugin.d.ts +11 -43
- package/src/lib/container/AsyncBoundaryPlugin.js +76 -86
- package/src/lib/container/AsyncBoundaryPlugin.js.map +1 -1
- package/src/lib/container/ContainerEntryModule.js +3 -1
- package/src/lib/container/ContainerEntryModule.js.map +1 -1
- package/src/lib/container/ContainerEntryModuleFactory.js +2 -1
- package/src/lib/container/ContainerEntryModuleFactory.js.map +1 -1
- package/src/lib/container/ContainerReferencePlugin.js +3 -1
- package/src/lib/container/ContainerReferencePlugin.js.map +1 -1
- package/src/lib/container/FallbackModuleFactory.js +2 -1
- package/src/lib/container/FallbackModuleFactory.js.map +1 -1
- package/src/lib/container/ModuleFederationPlugin.js +1 -1
- package/src/lib/container/ModuleFederationPlugin.js.map +1 -1
- package/src/lib/sharing/ConsumeSharedModule.js +3 -1
- package/src/lib/sharing/ConsumeSharedModule.js.map +1 -1
- package/src/lib/sharing/ConsumeSharedPlugin.js +3 -1
- package/src/lib/sharing/ConsumeSharedPlugin.js.map +1 -1
- package/src/lib/sharing/ConsumeSharedRuntimeModule.js +3 -1
- package/src/lib/sharing/ConsumeSharedRuntimeModule.js.map +1 -1
- package/src/lib/sharing/ProvideSharedModule.js +3 -1
- package/src/lib/sharing/ProvideSharedModule.js.map +1 -1
- package/src/lib/sharing/ShareRuntimeModule.js +3 -1
- package/src/lib/sharing/ShareRuntimeModule.js.map +1 -1
- package/src/lib/sharing/utils.js +6 -6
- package/src/lib/sharing/utils.js.map +1 -1
- package/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.d.ts +5 -0
- package/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js +34 -0
- package/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js.map +1 -0
- package/src/schemas/container/ModuleFederationPlugin.check.d.ts +10 -0
- package/CHANGELOG.md +0 -120
- package/README.md +0 -11
package/package.json
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"public": true,
|
|
3
2
|
"name": "@module-federation/enhanced",
|
|
4
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.2.0-canary.1",
|
|
5
4
|
"type": "commonjs",
|
|
6
5
|
"main": "./src/index.js",
|
|
7
6
|
"types": "src/index.d.ts",
|
|
8
7
|
"publishConfig": {
|
|
9
|
-
"
|
|
8
|
+
"access": "public"
|
|
10
9
|
},
|
|
11
10
|
"peerDependencies": {
|
|
12
11
|
"webpack": "^5.0.0"
|
|
13
12
|
},
|
|
14
13
|
"dependencies": {
|
|
15
|
-
"tapable": "2.2.1",
|
|
16
14
|
"webpack-sources": "3.2.3"
|
|
17
15
|
}
|
|
18
16
|
}
|
package/src/index.js
CHANGED
|
@@ -9,26 +9,26 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
|
|
13
|
-
return
|
|
12
|
+
AsyncBoundaryPlugin: function() {
|
|
13
|
+
return _AsyncBoundaryPlugin.default;
|
|
14
14
|
},
|
|
15
|
-
|
|
16
|
-
return
|
|
15
|
+
ContainerEntryModule: function() {
|
|
16
|
+
return _ContainerEntryModule.default;
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
return
|
|
18
|
+
ContainerPlugin: function() {
|
|
19
|
+
return _ContainerPlugin.default;
|
|
20
20
|
},
|
|
21
21
|
ContainerReferencePlugin: function() {
|
|
22
22
|
return _ContainerReferencePlugin.default;
|
|
23
23
|
},
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
ModuleFederationPlugin: function() {
|
|
25
|
+
return _ModuleFederationPlugin.default;
|
|
26
26
|
},
|
|
27
|
-
|
|
28
|
-
return
|
|
27
|
+
ModuleInfoRuntimeModule: function() {
|
|
28
|
+
return _ModuleInfoRuntimeModule.ModuleInfoRuntimeModule;
|
|
29
29
|
},
|
|
30
|
-
|
|
31
|
-
return
|
|
30
|
+
ModuleInfoRuntimePlugin: function() {
|
|
31
|
+
return _ModuleInfoRuntimePlugin.ModuleInfoRuntimePlugin;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
const _ModuleInfoRuntimeModule = require("./runtime/ModuleInfoRuntimeModule");
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../packages/enhanced/src/index.ts"],"sourcesContent":["export { ModuleInfoRuntimeModule } from './runtime/ModuleInfoRuntimeModule';\nexport { ModuleInfoRuntimePlugin } from './runtime/ModuleInfoRuntimePlugin';\nexport { default as ModuleFederationPlugin } from './lib/container/ModuleFederationPlugin';\nexport { default as ContainerReferencePlugin } from './lib/container/ContainerReferencePlugin';\nexport { default as ContainerPlugin } from './lib/container/ContainerPlugin';\nexport { default as ContainerEntryModule } from './lib/container/ContainerEntryModule';\nexport { default as AsyncBoundaryPlugin } from './lib/container/AsyncBoundaryPlugin';\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../../packages/enhanced/src/index.ts"],"sourcesContent":["export { ModuleInfoRuntimeModule } from './runtime/ModuleInfoRuntimeModule';\nexport { ModuleInfoRuntimePlugin } from './runtime/ModuleInfoRuntimePlugin';\nexport { default as ModuleFederationPlugin } from './lib/container/ModuleFederationPlugin';\nexport { default as ContainerReferencePlugin } from './lib/container/ContainerReferencePlugin';\nexport { default as ContainerPlugin } from './lib/container/ContainerPlugin';\nexport { default as ContainerEntryModule } from './lib/container/ContainerEntryModule';\nexport { default as AsyncBoundaryPlugin } from './lib/container/AsyncBoundaryPlugin';\n"],"names":["AsyncBoundaryPlugin","ContainerEntryModule","ContainerPlugin","ContainerReferencePlugin","ModuleFederationPlugin","ModuleInfoRuntimeModule","ModuleInfoRuntimePlugin"],"mappings":";;;;;;;;;;;IAMoBA,mBAAmB;eAAnBA,4BAAmB;;IADnBC,oBAAoB;eAApBA,6BAAoB;;IADpBC,eAAe;eAAfA,wBAAe;;IADfC,wBAAwB;eAAxBA,iCAAwB;;IADxBC,sBAAsB;eAAtBA,+BAAsB;;IAFjCC,uBAAuB;eAAvBA,gDAAuB;;IACvBC,uBAAuB;eAAvBA,gDAAuB;;;yCADQ;yCACA;+EACU;iFACE;wEACT;6EACK;4EACD"}
|
package/src/lib/Constants.js
CHANGED
|
@@ -14,68 +14,68 @@ function _export(target, all) {
|
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
_export(exports, {
|
|
17
|
-
|
|
18
|
-
return
|
|
19
|
-
},
|
|
20
|
-
JAVASCRIPT_MODULE_TYPE_DYNAMIC: function() {
|
|
21
|
-
return JAVASCRIPT_MODULE_TYPE_DYNAMIC;
|
|
17
|
+
ASSET_MODULE_TYPE: function() {
|
|
18
|
+
return ASSET_MODULE_TYPE;
|
|
22
19
|
},
|
|
23
|
-
|
|
24
|
-
return
|
|
20
|
+
ASSET_MODULE_TYPE_INLINE: function() {
|
|
21
|
+
return ASSET_MODULE_TYPE_INLINE;
|
|
25
22
|
},
|
|
26
|
-
|
|
27
|
-
return
|
|
23
|
+
ASSET_MODULE_TYPE_RAW_DATA_URL: function() {
|
|
24
|
+
return ASSET_MODULE_TYPE_RAW_DATA_URL;
|
|
28
25
|
},
|
|
29
|
-
|
|
30
|
-
return
|
|
26
|
+
ASSET_MODULE_TYPE_RESOURCE: function() {
|
|
27
|
+
return ASSET_MODULE_TYPE_RESOURCE;
|
|
31
28
|
},
|
|
32
|
-
|
|
33
|
-
return
|
|
29
|
+
ASSET_MODULE_TYPE_SOURCE: function() {
|
|
30
|
+
return ASSET_MODULE_TYPE_SOURCE;
|
|
34
31
|
},
|
|
35
32
|
CSS_MODULE_TYPE: function() {
|
|
36
33
|
return CSS_MODULE_TYPE;
|
|
37
34
|
},
|
|
35
|
+
CSS_MODULE_TYPE_AUTO: function() {
|
|
36
|
+
return CSS_MODULE_TYPE_AUTO;
|
|
37
|
+
},
|
|
38
38
|
CSS_MODULE_TYPE_GLOBAL: function() {
|
|
39
39
|
return CSS_MODULE_TYPE_GLOBAL;
|
|
40
40
|
},
|
|
41
41
|
CSS_MODULE_TYPE_MODULE: function() {
|
|
42
42
|
return CSS_MODULE_TYPE_MODULE;
|
|
43
43
|
},
|
|
44
|
-
|
|
45
|
-
return
|
|
44
|
+
JAVASCRIPT_MODULE_TYPE_AUTO: function() {
|
|
45
|
+
return JAVASCRIPT_MODULE_TYPE_AUTO;
|
|
46
46
|
},
|
|
47
|
-
|
|
48
|
-
return
|
|
47
|
+
JAVASCRIPT_MODULE_TYPE_DYNAMIC: function() {
|
|
48
|
+
return JAVASCRIPT_MODULE_TYPE_DYNAMIC;
|
|
49
49
|
},
|
|
50
|
-
|
|
51
|
-
return
|
|
50
|
+
JAVASCRIPT_MODULE_TYPE_ESM: function() {
|
|
51
|
+
return JAVASCRIPT_MODULE_TYPE_ESM;
|
|
52
52
|
},
|
|
53
|
-
|
|
54
|
-
return
|
|
53
|
+
JSON_MODULE_TYPE: function() {
|
|
54
|
+
return JSON_MODULE_TYPE;
|
|
55
55
|
},
|
|
56
|
-
|
|
57
|
-
return
|
|
56
|
+
WEBASSEMBLY_MODULE_TYPE_ASYNC: function() {
|
|
57
|
+
return WEBASSEMBLY_MODULE_TYPE_ASYNC;
|
|
58
58
|
},
|
|
59
|
-
|
|
60
|
-
return
|
|
59
|
+
WEBASSEMBLY_MODULE_TYPE_SYNC: function() {
|
|
60
|
+
return WEBASSEMBLY_MODULE_TYPE_SYNC;
|
|
61
61
|
},
|
|
62
|
-
|
|
63
|
-
return
|
|
62
|
+
WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE: function() {
|
|
63
|
+
return WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE;
|
|
64
64
|
},
|
|
65
65
|
WEBPACK_MODULE_TYPE_FALLBACK: function() {
|
|
66
66
|
return WEBPACK_MODULE_TYPE_FALLBACK;
|
|
67
67
|
},
|
|
68
|
-
|
|
69
|
-
return
|
|
68
|
+
WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY: function() {
|
|
69
|
+
return WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY;
|
|
70
70
|
},
|
|
71
71
|
WEBPACK_MODULE_TYPE_PROVIDE: function() {
|
|
72
72
|
return WEBPACK_MODULE_TYPE_PROVIDE;
|
|
73
73
|
},
|
|
74
|
-
|
|
75
|
-
return
|
|
74
|
+
WEBPACK_MODULE_TYPE_REMOTE: function() {
|
|
75
|
+
return WEBPACK_MODULE_TYPE_REMOTE;
|
|
76
76
|
},
|
|
77
|
-
|
|
78
|
-
return
|
|
77
|
+
WEBPACK_MODULE_TYPE_RUNTIME: function() {
|
|
78
|
+
return WEBPACK_MODULE_TYPE_RUNTIME;
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
const JAVASCRIPT_MODULE_TYPE_AUTO = 'javascript/auto';
|
package/src/lib/Constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../packages/enhanced/src/lib/Constants.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Sean Larkin @TheLarkInn\n*/\n\n/**\n * @type {Readonly<\"javascript/auto\">}\n */\nexport const JAVASCRIPT_MODULE_TYPE_AUTO: Readonly<'javascript/auto'> =\n 'javascript/auto';\n\n/**\n * @type {Readonly<\"javascript/dynamic\">}\n */\nexport const JAVASCRIPT_MODULE_TYPE_DYNAMIC: Readonly<'javascript/dynamic'> =\n 'javascript/dynamic';\n\n/**\n * @type {Readonly<\"javascript/esm\">}\n * This is the module type used for _strict_ ES Module syntax. This means that all legacy formats\n * that webpack supports (CommonJS, AMD, SystemJS) are not supported.\n */\nexport const JAVASCRIPT_MODULE_TYPE_ESM: Readonly<'javascript/esm'> =\n 'javascript/esm';\n\n/**\n * @type {Readonly<\"json\">}\n * This is the module type used for JSON files. JSON files are always parsed as ES Module.\n */\nexport const JSON_MODULE_TYPE: Readonly<'json'> = 'json';\n\n/**\n * @type {Readonly<\"webassembly/async\">}\n * This is the module type used for WebAssembly modules. In webpack 5 they are always treated as async modules.\n *\n */\nexport const WEBASSEMBLY_MODULE_TYPE_ASYNC: Readonly<'webassembly/async'> =\n 'webassembly/async';\n\n/**\n * @type {Readonly<\"webassembly/sync\">}\n * This is the module type used for WebAssembly modules. In webpack 4 they are always treated as sync modules.\n * There is a legacy option to support this usage in webpack 5 and up.\n */\nexport const WEBASSEMBLY_MODULE_TYPE_SYNC: Readonly<'webassembly/sync'> =\n 'webassembly/sync';\n\n/**\n * @type {Readonly<\"css\">}\n * This is the module type used for CSS files.\n */\nexport const CSS_MODULE_TYPE: Readonly<'css'> = 'css';\n\n/**\n * @type {Readonly<\"css/global\">}\n * This is the module type used for CSS modules files where you need to use `:local` in selector list to hash classes.\n */\nexport const CSS_MODULE_TYPE_GLOBAL: Readonly<'css/global'> = 'css/global';\n\n/**\n * @type {Readonly<\"css/module\">}\n * This is the module type used for CSS modules files, by default all classes are hashed.\n */\nexport const CSS_MODULE_TYPE_MODULE: Readonly<'css/module'> = 'css/module';\n\n/**\n * @type {Readonly<\"css/auto\">}\n * This is the module type used for CSS files, the module will be parsed as CSS modules if it's filename contains `.module.` or `.modules.`.\n */\nexport const CSS_MODULE_TYPE_AUTO: Readonly<'css/auto'> = 'css/auto';\n\n/**\n * @type {Readonly<\"asset\">}\n * This is the module type used for automatically choosing between `asset/inline`, `asset/resource` based on asset size limit (8096).\n */\nexport const ASSET_MODULE_TYPE: Readonly<'asset'> = 'asset';\n\n/**\n * @type {Readonly<\"asset/inline\">}\n * This is the module type used for assets that are inlined as a data URI. This is the equivalent of `url-loader`.\n */\nexport const ASSET_MODULE_TYPE_INLINE: Readonly<'asset/inline'> =\n 'asset/inline';\n\n/**\n * @type {Readonly<\"asset/resource\">}\n * This is the module type used for assets that are copied to the output directory. This is the equivalent of `file-loader`.\n */\nexport const ASSET_MODULE_TYPE_RESOURCE: Readonly<'asset/resource'> =\n 'asset/resource';\n\n/**\n * @type {Readonly<\"asset/source\">}\n * This is the module type used for assets that are imported as source code. This is the equivalent of `raw-loader`.\n */\nexport const ASSET_MODULE_TYPE_SOURCE: Readonly<'asset/source'> =\n 'asset/source';\n\n/**\n * @type {Readonly<\"asset/raw-data-url\">}\n * TODO: Document what this asset type is for. See css-loader tests for its usage.\n */\nexport const ASSET_MODULE_TYPE_RAW_DATA_URL: Readonly<'asset/raw-data-url'> =\n 'asset/raw-data-url';\n\n/**\n * @type {Readonly<\"runtime\">}\n * This is the module type used for the webpack runtime abstractions.\n */\nexport const WEBPACK_MODULE_TYPE_RUNTIME: Readonly<'runtime'> = 'runtime';\n\n/**\n * @type {Readonly<\"fallback-module\">}\n * This is the module type used for the ModuleFederation feature's FallbackModule class.\n * TODO: Document this better.\n */\nexport const WEBPACK_MODULE_TYPE_FALLBACK: Readonly<'fallback-module'> =\n 'fallback-module';\n\n/**\n * @type {Readonly<\"remote-module\">}\n * This is the module type used for the ModuleFederation feature's RemoteModule class.\n * TODO: Document this better.\n */\nexport const WEBPACK_MODULE_TYPE_REMOTE: Readonly<'remote-module'> =\n 'remote-module';\n\n/**\n * @type {Readonly<\"provide-module\">}\n * This is the module type used for the ModuleFederation feature's ProvideModule class.\n * TODO: Document this better.\n */\nexport const WEBPACK_MODULE_TYPE_PROVIDE: Readonly<'provide-module'> =\n 'provide-module';\n\n/**\n * @type {Readonly<\"consume-shared-module\">}\n * This is the module type used for the ModuleFederation feature's ConsumeSharedModule class.\n */\nexport const WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE: Readonly<'consume-shared-module'> =\n 'consume-shared-module';\n\n/**\n * @type {Readonly<\"lazy-compilation-proxy\">}\n * Module type used for `experiments.lazyCompilation` feature. See `LazyCompilationPlugin` for more information.\n */\nexport const WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY: Readonly<'lazy-compilation-proxy'> =\n 'lazy-compilation-proxy';\n\n/** @typedef {\"javascript/auto\" | \"javascript/dynamic\" | \"javascript/esm\"} JavaScriptModuleTypes */\n/** @typedef {\"json\"} JSONModuleType */\n/** @typedef {\"webassembly/async\" | \"webassembly/sync\"} WebAssemblyModuleTypes */\n/** @typedef {\"css\" | \"css/global\" | \"css/module\"} CSSModuleTypes */\n/** @typedef {\"asset\" | \"asset/inline\" | \"asset/resource\" | \"asset/source\" | \"asset/raw-data-url\"} AssetModuleTypes */\n/** @typedef {\"runtime\" | \"fallback-module\" | \"remote-module\" | \"provide-module\" | \"consume-shared-module\" | \"lazy-compilation-proxy\"} WebpackModuleTypes */\n/** @typedef {string} UnknownModuleTypes */\n/** @typedef {JavaScriptModuleTypes | JSONModuleType | WebAssemblyModuleTypes | CSSModuleTypes | AssetModuleTypes | WebpackModuleTypes | UnknownModuleTypes} ModuleTypes */\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../../../packages/enhanced/src/lib/Constants.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Sean Larkin @TheLarkInn\n*/\n\n/**\n * @type {Readonly<\"javascript/auto\">}\n */\nexport const JAVASCRIPT_MODULE_TYPE_AUTO: Readonly<'javascript/auto'> =\n 'javascript/auto';\n\n/**\n * @type {Readonly<\"javascript/dynamic\">}\n */\nexport const JAVASCRIPT_MODULE_TYPE_DYNAMIC: Readonly<'javascript/dynamic'> =\n 'javascript/dynamic';\n\n/**\n * @type {Readonly<\"javascript/esm\">}\n * This is the module type used for _strict_ ES Module syntax. This means that all legacy formats\n * that webpack supports (CommonJS, AMD, SystemJS) are not supported.\n */\nexport const JAVASCRIPT_MODULE_TYPE_ESM: Readonly<'javascript/esm'> =\n 'javascript/esm';\n\n/**\n * @type {Readonly<\"json\">}\n * This is the module type used for JSON files. JSON files are always parsed as ES Module.\n */\nexport const JSON_MODULE_TYPE: Readonly<'json'> = 'json';\n\n/**\n * @type {Readonly<\"webassembly/async\">}\n * This is the module type used for WebAssembly modules. In webpack 5 they are always treated as async modules.\n *\n */\nexport const WEBASSEMBLY_MODULE_TYPE_ASYNC: Readonly<'webassembly/async'> =\n 'webassembly/async';\n\n/**\n * @type {Readonly<\"webassembly/sync\">}\n * This is the module type used for WebAssembly modules. In webpack 4 they are always treated as sync modules.\n * There is a legacy option to support this usage in webpack 5 and up.\n */\nexport const WEBASSEMBLY_MODULE_TYPE_SYNC: Readonly<'webassembly/sync'> =\n 'webassembly/sync';\n\n/**\n * @type {Readonly<\"css\">}\n * This is the module type used for CSS files.\n */\nexport const CSS_MODULE_TYPE: Readonly<'css'> = 'css';\n\n/**\n * @type {Readonly<\"css/global\">}\n * This is the module type used for CSS modules files where you need to use `:local` in selector list to hash classes.\n */\nexport const CSS_MODULE_TYPE_GLOBAL: Readonly<'css/global'> = 'css/global';\n\n/**\n * @type {Readonly<\"css/module\">}\n * This is the module type used for CSS modules files, by default all classes are hashed.\n */\nexport const CSS_MODULE_TYPE_MODULE: Readonly<'css/module'> = 'css/module';\n\n/**\n * @type {Readonly<\"css/auto\">}\n * This is the module type used for CSS files, the module will be parsed as CSS modules if it's filename contains `.module.` or `.modules.`.\n */\nexport const CSS_MODULE_TYPE_AUTO: Readonly<'css/auto'> = 'css/auto';\n\n/**\n * @type {Readonly<\"asset\">}\n * This is the module type used for automatically choosing between `asset/inline`, `asset/resource` based on asset size limit (8096).\n */\nexport const ASSET_MODULE_TYPE: Readonly<'asset'> = 'asset';\n\n/**\n * @type {Readonly<\"asset/inline\">}\n * This is the module type used for assets that are inlined as a data URI. This is the equivalent of `url-loader`.\n */\nexport const ASSET_MODULE_TYPE_INLINE: Readonly<'asset/inline'> =\n 'asset/inline';\n\n/**\n * @type {Readonly<\"asset/resource\">}\n * This is the module type used for assets that are copied to the output directory. This is the equivalent of `file-loader`.\n */\nexport const ASSET_MODULE_TYPE_RESOURCE: Readonly<'asset/resource'> =\n 'asset/resource';\n\n/**\n * @type {Readonly<\"asset/source\">}\n * This is the module type used for assets that are imported as source code. This is the equivalent of `raw-loader`.\n */\nexport const ASSET_MODULE_TYPE_SOURCE: Readonly<'asset/source'> =\n 'asset/source';\n\n/**\n * @type {Readonly<\"asset/raw-data-url\">}\n * TODO: Document what this asset type is for. See css-loader tests for its usage.\n */\nexport const ASSET_MODULE_TYPE_RAW_DATA_URL: Readonly<'asset/raw-data-url'> =\n 'asset/raw-data-url';\n\n/**\n * @type {Readonly<\"runtime\">}\n * This is the module type used for the webpack runtime abstractions.\n */\nexport const WEBPACK_MODULE_TYPE_RUNTIME: Readonly<'runtime'> = 'runtime';\n\n/**\n * @type {Readonly<\"fallback-module\">}\n * This is the module type used for the ModuleFederation feature's FallbackModule class.\n * TODO: Document this better.\n */\nexport const WEBPACK_MODULE_TYPE_FALLBACK: Readonly<'fallback-module'> =\n 'fallback-module';\n\n/**\n * @type {Readonly<\"remote-module\">}\n * This is the module type used for the ModuleFederation feature's RemoteModule class.\n * TODO: Document this better.\n */\nexport const WEBPACK_MODULE_TYPE_REMOTE: Readonly<'remote-module'> =\n 'remote-module';\n\n/**\n * @type {Readonly<\"provide-module\">}\n * This is the module type used for the ModuleFederation feature's ProvideModule class.\n * TODO: Document this better.\n */\nexport const WEBPACK_MODULE_TYPE_PROVIDE: Readonly<'provide-module'> =\n 'provide-module';\n\n/**\n * @type {Readonly<\"consume-shared-module\">}\n * This is the module type used for the ModuleFederation feature's ConsumeSharedModule class.\n */\nexport const WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE: Readonly<'consume-shared-module'> =\n 'consume-shared-module';\n\n/**\n * @type {Readonly<\"lazy-compilation-proxy\">}\n * Module type used for `experiments.lazyCompilation` feature. See `LazyCompilationPlugin` for more information.\n */\nexport const WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY: Readonly<'lazy-compilation-proxy'> =\n 'lazy-compilation-proxy';\n\n/** @typedef {\"javascript/auto\" | \"javascript/dynamic\" | \"javascript/esm\"} JavaScriptModuleTypes */\n/** @typedef {\"json\"} JSONModuleType */\n/** @typedef {\"webassembly/async\" | \"webassembly/sync\"} WebAssemblyModuleTypes */\n/** @typedef {\"css\" | \"css/global\" | \"css/module\"} CSSModuleTypes */\n/** @typedef {\"asset\" | \"asset/inline\" | \"asset/resource\" | \"asset/source\" | \"asset/raw-data-url\"} AssetModuleTypes */\n/** @typedef {\"runtime\" | \"fallback-module\" | \"remote-module\" | \"provide-module\" | \"consume-shared-module\" | \"lazy-compilation-proxy\"} WebpackModuleTypes */\n/** @typedef {string} UnknownModuleTypes */\n/** @typedef {JavaScriptModuleTypes | JSONModuleType | WebAssemblyModuleTypes | CSSModuleTypes | AssetModuleTypes | WebpackModuleTypes | UnknownModuleTypes} ModuleTypes */\n"],"names":["ASSET_MODULE_TYPE","ASSET_MODULE_TYPE_INLINE","ASSET_MODULE_TYPE_RAW_DATA_URL","ASSET_MODULE_TYPE_RESOURCE","ASSET_MODULE_TYPE_SOURCE","CSS_MODULE_TYPE","CSS_MODULE_TYPE_AUTO","CSS_MODULE_TYPE_GLOBAL","CSS_MODULE_TYPE_MODULE","JAVASCRIPT_MODULE_TYPE_AUTO","JAVASCRIPT_MODULE_TYPE_DYNAMIC","JAVASCRIPT_MODULE_TYPE_ESM","JSON_MODULE_TYPE","WEBASSEMBLY_MODULE_TYPE_ASYNC","WEBASSEMBLY_MODULE_TYPE_SYNC","WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE","WEBPACK_MODULE_TYPE_FALLBACK","WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY","WEBPACK_MODULE_TYPE_PROVIDE","WEBPACK_MODULE_TYPE_REMOTE","WEBPACK_MODULE_TYPE_RUNTIME"],"mappings":"AAAA;;;AAGA,GAEA;;CAEC;;;;;;;;;;;IAoEYA,iBAAiB;eAAjBA;;IAMAC,wBAAwB;eAAxBA;;IAqBAC,8BAA8B;eAA9BA;;IAdAC,0BAA0B;eAA1BA;;IAOAC,wBAAwB;eAAxBA;;IA5CAC,eAAe;eAAfA;;IAkBAC,oBAAoB;eAApBA;;IAZAC,sBAAsB;eAAtBA;;IAMAC,sBAAsB;eAAtBA;;IAvDAC,2BAA2B;eAA3BA;;IAMAC,8BAA8B;eAA9BA;;IAQAC,0BAA0B;eAA1BA;;IAOAC,gBAAgB;eAAhBA;;IAOAC,6BAA6B;eAA7BA;;IAQAC,4BAA4B;eAA5BA;;IA+FAC,yCAAyC;eAAzCA;;IAvBAC,4BAA4B;eAA5BA;;IA8BAC,0CAA0C;eAA1CA;;IAdAC,2BAA2B;eAA3BA;;IARAC,0BAA0B;eAA1BA;;IAfAC,2BAA2B;eAA3BA;;;AArGN,MAAMX,8BACX;AAKK,MAAMC,iCACX;AAOK,MAAMC,6BACX;AAMK,MAAMC,mBAAqC;AAO3C,MAAMC,gCACX;AAOK,MAAMC,+BACX;AAMK,MAAMT,kBAAmC;AAMzC,MAAME,yBAAiD;AAMvD,MAAMC,yBAAiD;AAMvD,MAAMF,uBAA6C;AAMnD,MAAMN,oBAAuC;AAM7C,MAAMC,2BACX;AAMK,MAAME,6BACX;AAMK,MAAMC,2BACX;AAMK,MAAMF,iCACX;AAMK,MAAMkB,8BAAmD;AAOzD,MAAMJ,+BACX;AAOK,MAAMG,6BACX;AAOK,MAAMD,8BACX;AAMK,MAAMH,4CACX;AAMK,MAAME,6CACX,0BAEF,iGAAiG,IACjG,qCAAqC,IACrC,+EAA+E,IAC/E,kEAAkE,IAClE,oHAAoH,IACpH,0JAA0J,IAC1J,yCAAyC,IACzC,yKAAyK"}
|
|
@@ -1,45 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* Define hooks
|
|
12
|
-
* @property {SyncBailHook} checkInvalidContext - A hook that checks if the render context is invalid.
|
|
13
|
-
*/
|
|
14
|
-
hooks: {
|
|
15
|
-
checkInvalidContext: SyncBailHook<[Module, Compilation], boolean, import("tapable").UnsetAdditionalOptions>;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Apply the plugin to the Webpack compiler instance.
|
|
19
|
-
* @param {Compiler} compiler - Webpack compiler instance.
|
|
20
|
-
*/
|
|
1
|
+
import Compiler from 'webpack/lib/Compiler';
|
|
2
|
+
import Chunk from 'webpack/lib/Chunk';
|
|
3
|
+
import Module from 'webpack/lib/Module';
|
|
4
|
+
interface Options {
|
|
5
|
+
eager?: RegExp | ((module: Module) => boolean);
|
|
6
|
+
excludeChunk?: (chunk: Chunk) => boolean;
|
|
7
|
+
}
|
|
8
|
+
declare class AsyncEntryStartupPlugin {
|
|
9
|
+
private _options;
|
|
10
|
+
constructor(options?: Options);
|
|
21
11
|
apply(compiler: Compiler): void;
|
|
22
|
-
/**
|
|
23
|
-
* Render the startup logic for the plugin.
|
|
24
|
-
* @param {Source} source - The source code.
|
|
25
|
-
* @param {RenderContext} renderContext - The render context.
|
|
26
|
-
* @param {any} startupRenderContext - The startup render context.
|
|
27
|
-
* @param {Compilation} compilation - The Webpack compilation instance.
|
|
28
|
-
* @returns {string} - The modified source code.
|
|
29
|
-
*/
|
|
30
|
-
private renderStartupLogic;
|
|
31
|
-
/**
|
|
32
|
-
* Replace the webpack exec string.
|
|
33
|
-
* @param {string} webpack_exec - The webpack exec string.
|
|
34
|
-
* @returns {string} - The replaced webpack exec string.
|
|
35
|
-
*/
|
|
36
|
-
private replaceWebpackExec;
|
|
37
|
-
/**
|
|
38
|
-
* Get the IDs of the dependent chunks.
|
|
39
|
-
* @param {any} startupRenderContext - The startup render context.
|
|
40
|
-
* @param {any} chunkGraph - The chunk graph.
|
|
41
|
-
* @returns {Set} - The set of dependent chunk IDs.
|
|
42
|
-
*/
|
|
43
|
-
private getDependentChunkIds;
|
|
44
12
|
}
|
|
45
|
-
export default
|
|
13
|
+
export default AsyncEntryStartupPlugin;
|
|
@@ -8,96 +8,86 @@ Object.defineProperty(exports, "default", {
|
|
|
8
8
|
return _default;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Render the startup logic for the plugin.
|
|
32
|
-
* @param {Source} source - The source code.
|
|
33
|
-
* @param {RenderContext} renderContext - The render context.
|
|
34
|
-
* @param {any} startupRenderContext - The startup render context.
|
|
35
|
-
* @param {Compilation} compilation - The Webpack compilation instance.
|
|
36
|
-
* @returns {string} - The modified source code.
|
|
37
|
-
*/ renderStartupLogic(source, renderContext, startupRenderContext, compilation) {
|
|
38
|
-
var _this_hooks_checkInvalidContext_call;
|
|
39
|
-
const isInvalidContext = (_this_hooks_checkInvalidContext_call = this.hooks.checkInvalidContext.call(renderContext, compilation)) != null ? _this_hooks_checkInvalidContext_call : false;
|
|
40
|
-
if (isInvalidContext) return source.source().toString();
|
|
41
|
-
const { chunkGraph } = compilation;
|
|
42
|
-
const replaceSource = source.source().toString();
|
|
43
|
-
const [webpack_exec, ...webpack_exports] = replaceSource.split('\n');
|
|
44
|
-
const dependentChunkIds = this.getDependentChunkIds(startupRenderContext, chunkGraph);
|
|
45
|
-
return _webpack.Template.asString([
|
|
46
|
-
this.replaceWebpackExec(webpack_exec),
|
|
47
|
-
`globalThis.ongoingRemotes = globalThis.ongoingRemotes || [];`,
|
|
48
|
-
`var __webpack_exec__ = async function() {`,
|
|
49
|
-
_webpack.Template.indent([
|
|
50
|
-
`var chunkIds = ${JSON.stringify(Array.from(dependentChunkIds))};`,
|
|
51
|
-
`chunkIds.forEach(function(id) { ${_webpack.RuntimeGlobals.ensureChunkHandlers}.consumes(id, globalThis.ongoingRemotes); });`,
|
|
52
|
-
`await Promise.all(globalThis.ongoingRemotes);`,
|
|
53
|
-
`chunkIds.forEach(function(id) { ${_webpack.RuntimeGlobals.ensureChunkHandlers}.remotes(id, globalThis.ongoingRemotes); });`,
|
|
54
|
-
`await Promise.all(globalThis.ongoingRemotes);`,
|
|
55
|
-
`return __original_webpack_exec__.apply(this, arguments);`
|
|
56
|
-
]),
|
|
57
|
-
`};`,
|
|
58
|
-
...webpack_exports
|
|
59
|
-
]);
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Replace the webpack exec string.
|
|
63
|
-
* @param {string} webpack_exec - The webpack exec string.
|
|
64
|
-
* @returns {string} - The replaced webpack exec string.
|
|
65
|
-
*/ replaceWebpackExec(webpack_exec) {
|
|
66
|
-
return webpack_exec.replace('__webpack_exec__', '__original_webpack_exec__');
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Get the IDs of the dependent chunks.
|
|
70
|
-
* @param {any} startupRenderContext - The startup render context.
|
|
71
|
-
* @param {any} chunkGraph - The chunk graph.
|
|
72
|
-
* @returns {Set} - The set of dependent chunk IDs.
|
|
73
|
-
*/ getDependentChunkIds(startupRenderContext, chunkGraph) {
|
|
74
|
-
const entries = Array.from(chunkGraph.getChunkEntryModulesWithChunkGroupIterable(startupRenderContext.chunk));
|
|
75
|
-
const chunkIds = new Set();
|
|
76
|
-
for (const [module, entrypoint] of entries){
|
|
77
|
-
if (entrypoint) {
|
|
78
|
-
const runtimeChunk = entrypoint.getRuntimeChunk();
|
|
79
|
-
if (runtimeChunk) {
|
|
80
|
-
const chunks = (0, _ChunkHelpers.getAllChunks)(entrypoint, runtimeChunk);
|
|
81
|
-
for (const c of chunks){
|
|
82
|
-
chunkIds.add(c.id);
|
|
11
|
+
const _RuntimeGlobals = /*#__PURE__*/ _interop_require_default(require("webpack/lib/RuntimeGlobals"));
|
|
12
|
+
const _Template = /*#__PURE__*/ _interop_require_default(require("webpack/lib/Template"));
|
|
13
|
+
function _interop_require_default(obj) {
|
|
14
|
+
return obj && obj.__esModule ? obj : {
|
|
15
|
+
default: obj
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
// Class to handle asynchronous entry startup
|
|
19
|
+
let AsyncEntryStartupPlugin = class AsyncEntryStartupPlugin {
|
|
20
|
+
apply(compiler) {
|
|
21
|
+
const chunkRuntimes = new Map();
|
|
22
|
+
compiler.hooks.thisCompilation.tap('AsyncEntryStartupPlugin', (compilation)=>{
|
|
23
|
+
compiler.webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(compilation).renderStartup.tap('AsyncEntryStartupPlugin', (source, renderContext, upperContext)=>{
|
|
24
|
+
var _compiler_options_optimization, _compiler_options;
|
|
25
|
+
// Check if single runtime chunk is enabled
|
|
26
|
+
if (compiler == null ? void 0 : (_compiler_options = compiler.options) == null ? void 0 : (_compiler_options_optimization = _compiler_options.optimization) == null ? void 0 : _compiler_options_optimization.runtimeChunk) {
|
|
27
|
+
if (upperContext == null ? void 0 : upperContext.chunk.hasRuntime()) {
|
|
28
|
+
chunkRuntimes.set(upperContext.chunk.id, upperContext.chunk);
|
|
29
|
+
return source;
|
|
83
30
|
}
|
|
84
31
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
32
|
+
// Check if excludeChunk is provided, use it to decide further processing
|
|
33
|
+
if (this._options.excludeChunk && this._options.excludeChunk(upperContext.chunk)) {
|
|
34
|
+
return source;
|
|
35
|
+
}
|
|
36
|
+
const runtime = chunkRuntimes.get(upperContext.chunk.runtime);
|
|
37
|
+
// Get the runtime requirements of the chunk
|
|
38
|
+
const requirements = compilation.chunkGraph.getTreeRuntimeRequirements(runtime || upperContext.chunk);
|
|
39
|
+
let remotes = '';
|
|
40
|
+
let shared = '';
|
|
41
|
+
const hasRemoteModules = compilation.chunkGraph.getChunkModulesIterableBySourceType(upperContext.chunk, 'remote');
|
|
42
|
+
// Check if the chunk has remote get scope
|
|
43
|
+
if (requirements.has(_RuntimeGlobals.default.currentRemoteGetScope) || hasRemoteModules || requirements.has('__webpack_require__.vmok')) {
|
|
44
|
+
remotes = `if(__webpack_require__.f && __webpack_require__.f.remotes) __webpack_require__.f.remotes(${JSON.stringify(upperContext.chunk.id)}, promiseTrack);`;
|
|
45
|
+
}
|
|
46
|
+
// Check if the chunk has share scope map or initialize sharing
|
|
47
|
+
if (requirements.has(_RuntimeGlobals.default.shareScopeMap) || requirements.has(_RuntimeGlobals.default.initializeSharing)) {
|
|
48
|
+
shared = `if(__webpack_require__.f && __webpack_require__.f.consumes) __webpack_require__.f.consumes(${JSON.stringify(upperContext.chunk.id)}, promiseTrack);`;
|
|
49
|
+
}
|
|
50
|
+
// If no remotes or shared, return the source
|
|
51
|
+
if (!remotes && !shared) {
|
|
52
|
+
return source;
|
|
53
|
+
}
|
|
54
|
+
// Get the entry modules of the chunk
|
|
55
|
+
const entryModules = compilation.chunkGraph.getChunkEntryModulesIterable(upperContext.chunk);
|
|
56
|
+
const initialEntryModules = [];
|
|
57
|
+
// Iterate over the entry modules
|
|
58
|
+
for (const entryModule of entryModules){
|
|
59
|
+
if (entryModule.id) {
|
|
60
|
+
let shouldInclude = false;
|
|
61
|
+
// Check if eager is a function and call it
|
|
62
|
+
if (typeof this._options.eager === 'function') {
|
|
63
|
+
shouldInclude = this._options.eager(entryModule);
|
|
64
|
+
} else if (this._options.eager && this._options.eager.test(entryModule.identifier())) {
|
|
65
|
+
// Check if eager is a RegExp and test it
|
|
66
|
+
shouldInclude = true;
|
|
67
|
+
}
|
|
68
|
+
// If shouldInclude is true, push the module to initialEntryModules
|
|
69
|
+
if (shouldInclude) {
|
|
70
|
+
initialEntryModules.push(`__webpack_require__(${JSON.stringify(entryModule.id)});`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return _Template.default.asString([
|
|
75
|
+
'var promiseTrack = [];',
|
|
76
|
+
_Template.default.asString(initialEntryModules),
|
|
77
|
+
shared,
|
|
78
|
+
remotes,
|
|
79
|
+
'var __webpack_exports__ = Promise.all(promiseTrack).then(function() {',
|
|
80
|
+
_Template.default.indent(source.source()),
|
|
81
|
+
_Template.default.indent('return __webpack_exports__'),
|
|
82
|
+
'});'
|
|
83
|
+
]);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
88
86
|
}
|
|
89
|
-
constructor(){
|
|
90
|
-
|
|
91
|
-
* Define hooks
|
|
92
|
-
* @property {SyncBailHook} checkInvalidContext - A hook that checks if the render context is invalid.
|
|
93
|
-
*/ this.hooks = {
|
|
94
|
-
checkInvalidContext: new _tapable.SyncBailHook([
|
|
95
|
-
'renderContext',
|
|
96
|
-
'compilation'
|
|
97
|
-
])
|
|
98
|
-
};
|
|
87
|
+
constructor(options){
|
|
88
|
+
this._options = options || {};
|
|
99
89
|
}
|
|
100
90
|
};
|
|
101
|
-
const _default =
|
|
91
|
+
const _default = AsyncEntryStartupPlugin;
|
|
102
92
|
|
|
103
93
|
//# sourceMappingURL=AsyncBoundaryPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/AsyncBoundaryPlugin.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/AsyncBoundaryPlugin.ts"],"sourcesContent":["import Compiler from 'webpack/lib/Compiler';\nimport Compilation from 'webpack/lib/Compilation';\nimport Chunk from 'webpack/lib/Chunk';\nimport RuntimeGlobals from 'webpack/lib/RuntimeGlobals';\nimport Template from 'webpack/lib/Template';\nimport Module from 'webpack/lib/Module';\n\ninterface Options {\n eager?: RegExp | ((module: Module) => boolean);\n excludeChunk?: (chunk: Chunk) => boolean;\n}\n\n// Class to handle asynchronous entry startup\nclass AsyncEntryStartupPlugin {\n private _options: Options;\n\n constructor(options?: Options) {\n this._options = options || {};\n }\n\n apply(compiler: Compiler): void {\n const chunkRuntimes = new Map();\n compiler.hooks.thisCompilation.tap(\n 'AsyncEntryStartupPlugin',\n (compilation: Compilation) => {\n compiler.webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(\n compilation,\n ).renderStartup.tap(\n 'AsyncEntryStartupPlugin',\n (\n source: any,\n renderContext: Module,\n upperContext: { chunk: Chunk },\n ) => {\n // Check if single runtime chunk is enabled\n if (compiler?.options?.optimization?.runtimeChunk) {\n if (upperContext?.chunk.hasRuntime()) {\n chunkRuntimes.set(upperContext.chunk.id, upperContext.chunk);\n return source;\n }\n }\n\n // Check if excludeChunk is provided, use it to decide further processing\n if (\n this._options.excludeChunk &&\n this._options.excludeChunk(upperContext.chunk)\n ) {\n return source;\n }\n\n const runtime = chunkRuntimes.get(upperContext.chunk.runtime);\n\n // Get the runtime requirements of the chunk\n const requirements =\n compilation.chunkGraph.getTreeRuntimeRequirements(\n runtime || upperContext.chunk,\n );\n\n let remotes = '';\n let shared = '';\n const hasRemoteModules =\n compilation.chunkGraph.getChunkModulesIterableBySourceType(\n upperContext.chunk,\n 'remote',\n );\n\n // Check if the chunk has remote get scope\n if (\n requirements.has(RuntimeGlobals.currentRemoteGetScope) ||\n hasRemoteModules ||\n requirements.has('__webpack_require__.vmok')\n ) {\n remotes = `if(__webpack_require__.f && __webpack_require__.f.remotes) __webpack_require__.f.remotes(${JSON.stringify(\n upperContext.chunk.id,\n )}, promiseTrack);`;\n }\n\n // Check if the chunk has share scope map or initialize sharing\n if (\n requirements.has(RuntimeGlobals.shareScopeMap) ||\n requirements.has(RuntimeGlobals.initializeSharing)\n ) {\n shared = `if(__webpack_require__.f && __webpack_require__.f.consumes) __webpack_require__.f.consumes(${JSON.stringify(\n upperContext.chunk.id,\n )}, promiseTrack);`;\n }\n\n // If no remotes or shared, return the source\n if (!remotes && !shared) {\n return source;\n }\n\n // Get the entry modules of the chunk\n const entryModules =\n compilation.chunkGraph.getChunkEntryModulesIterable(\n upperContext.chunk,\n );\n\n const initialEntryModules = [];\n\n // Iterate over the entry modules\n for (const entryModule of entryModules) {\n if (entryModule.id) {\n let shouldInclude = false;\n\n // Check if eager is a function and call it\n if (typeof this._options.eager === 'function') {\n shouldInclude = this._options.eager(entryModule);\n } else if (\n this._options.eager &&\n this._options.eager.test(entryModule.identifier())\n ) {\n // Check if eager is a RegExp and test it\n shouldInclude = true;\n }\n\n // If shouldInclude is true, push the module to initialEntryModules\n if (shouldInclude) {\n initialEntryModules.push(\n `__webpack_require__(${JSON.stringify(entryModule.id)});`,\n );\n }\n }\n }\n\n return Template.asString([\n 'var promiseTrack = [];',\n Template.asString(initialEntryModules),\n shared,\n remotes,\n 'var __webpack_exports__ = Promise.all(promiseTrack).then(function() {',\n Template.indent(source.source()),\n Template.indent('return __webpack_exports__'),\n '});',\n ]);\n },\n );\n },\n );\n }\n}\n\nexport default AsyncEntryStartupPlugin;\n"],"names":["AsyncEntryStartupPlugin","apply","compiler","chunkRuntimes","Map","hooks","thisCompilation","tap","compilation","webpack","javascript","JavascriptModulesPlugin","getCompilationHooks","renderStartup","source","renderContext","upperContext","options","optimization","runtimeChunk","chunk","hasRuntime","set","id","_options","excludeChunk","runtime","get","requirements","chunkGraph","getTreeRuntimeRequirements","remotes","shared","hasRemoteModules","getChunkModulesIterableBySourceType","has","RuntimeGlobals","currentRemoteGetScope","JSON","stringify","shareScopeMap","initializeSharing","entryModules","getChunkEntryModulesIterable","initialEntryModules","entryModule","shouldInclude","eager","test","identifier","push","Template","asString","indent","constructor"],"mappings":";;;;+BA8IA;;;eAAA;;;uEA3I2B;iEACN;;;;;;AAQrB,6CAA6C;AAC7C,IAAA,AAAMA,0BAAN,MAAMA;IAOJC,MAAMC,QAAkB,EAAQ;QAC9B,MAAMC,gBAAgB,IAAIC;QAC1BF,SAASG,KAAK,CAACC,eAAe,CAACC,GAAG,CAChC,2BACA,CAACC;YACCN,SAASO,OAAO,CAACC,UAAU,CAACC,uBAAuB,CAACC,mBAAmB,CACrEJ,aACAK,aAAa,CAACN,GAAG,CACjB,2BACA,CACEO,QACAC,eACAC;oBAGId,gC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Q;oBACvB,OAAOlB;gBACT;gBAEA,qCAAqC;gBACrC,MAAM4B,eACJlC,YAAYqB,UAAU,CAACc,4BAA4B,CACjD3B,aAAaI,KAAK;gBAGtB,MAAMwB,sBAAsB,EAAE;gBAE9B,iCAAiC;gBACjC,KAAK,MAAMC,eAAeH,aAAc;oBACtC,IAAIG,YAAYtB,EAAE,EAAE;wBAClB,IAAIuB,gBAAgB;wBAEpB,2CAA2C;wBAC3C,IAAI,OAAO,IAAI,CAACtB,QAAQ,CAACuB,KAAK,KAAK,YAAY;4BAC7CD,gBAAgB,IAAI,CAACtB,QAAQ,CAACuB,KAAK,CAACF;wBACtC,OAAO,IACL,IAAI,CAACrB,QAAQ,CAACuB,KAAK,IACnB,IAAI,CAACvB,QAAQ,CAACuB,KAAK,CAACC,IAAI,CAACH,YAAYI,UAAU,KAC/C;4BACA,yCAAyC;4BACzCH,gBAAgB;wBAClB;wBAEA,mEAAmE;wBACnE,IAAIA,eAAe;4BACjBF,oBAAoBM,IAAI,CACtB,CAAC,oBAAoB,EAAEZ,KAAKC,SAAS,CAACM,YAAYtB,EAAE,EAAE,EAAE,CAAC;wBAE7D;oBACF;gBACF;gBAEA,OAAO4B,iBAAQ,CAACC,QAAQ,CAAC;oBACvB;oBACAD,iBAAQ,CAACC,QAAQ,CAACR;oBAClBZ;oBACAD;oBACA;oBACAoB,iBAAQ,CAACE,MAAM,CAACvC,OAAOA,MAAM;oBAC7BqC,iBAAQ,CAACE,MAAM,CAAC;oBAChB;iBACD;YACH;QAEJ;IAEJ;IA3HAC,YAAYrC,OAAiB,CAAE;QAC7B,IAAI,CAACO,QAAQ,GAAGP,WAAW,CAAC;IAC9B;AA0HF;MAEA,WAAejB"}
|
|
@@ -46,7 +46,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
46
46
|
if (cache && cache.has(obj)) {
|
|
47
47
|
return cache.get(obj);
|
|
48
48
|
}
|
|
49
|
-
var newObj = {
|
|
49
|
+
var newObj = {
|
|
50
|
+
__proto__: null
|
|
51
|
+
};
|
|
50
52
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
51
53
|
for(var key in obj){
|
|
52
54
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/ContainerEntryModule.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy, Marais Rossouw @maraisr\n*/\n\n'use strict';\nimport AsyncDependenciesBlock from 'webpack/lib/AsyncDependenciesBlock';\nimport Dependency from 'webpack/lib/Dependency';\nimport Template from 'webpack/lib/Template';\nimport Module from 'webpack/lib/Module';\nimport * as RuntimeGlobals from 'webpack/lib/RuntimeGlobals';\nimport { OriginalSource, RawSource } from 'webpack-sources';\nimport { JAVASCRIPT_MODULE_TYPE_DYNAMIC } from 'webpack/lib/ModuleTypeConstants';\nimport ContainerExposedDependency from './ContainerExposedDependency';\nimport StaticExportsDependency from 'webpack/lib/dependencies/StaticExportsDependency';\nimport type Compilation from 'webpack/lib/Compilation';\nimport type {\n LibIdentOptions,\n NeedBuildContext,\n RequestShortener,\n ObjectDeserializerContext,\n ObjectSerializerContext,\n WebpackOptions,\n InputFileSystem,\n ResolverWithOptions,\n} from 'webpack/lib/Module';\nimport type WebpackError from 'webpack/lib/WebpackError';\nimport makeSerializable from 'webpack/lib/util/makeSerializable';\n\nconst SOURCE_TYPES = new Set(['javascript']);\n\nexport type ExposeOptions = {\n /**\n * requests to exposed modules (last one is exported)\n */\n import: string[];\n /**\n * custom chunk name for the exposed module\n */\n name: string;\n};\n\nclass ContainerEntryModule extends Module {\n private _name: string;\n private _exposes: [string, ExposeOptions][];\n private _shareScope: string;\n /**\n * @param {string} name container entry name\n * @param {[string, ExposeOptions][]} exposes list of exposed modules\n * @param {string} shareScope name of the share scope\n */\n constructor(\n name: string,\n exposes: [string, ExposeOptions][],\n shareScope: string,\n ) {\n super(JAVASCRIPT_MODULE_TYPE_DYNAMIC, null);\n this._name = name;\n this._exposes = exposes;\n this._shareScope = shareScope;\n }\n /**\n * @param {ObjectDeserializerContext} context context\n * @returns {ContainerEntryModule} deserialized container entry module\n */\n static deserialize(context: ObjectDeserializerContext): ContainerEntryModule {\n const { read } = context;\n const obj = new ContainerEntryModule(read(), read(), read());\n //@ts-ignore\n obj.deserialize(context);\n return obj;\n }\n\n /**\n * @returns {Set<string>} types available (do not mutate)\n */\n override getSourceTypes(): Set<string> {\n return SOURCE_TYPES;\n }\n /**\n * @returns {string} a unique identifier of the module\n */\n override identifier(): string {\n return `container entry (${this._shareScope}) ${JSON.stringify(\n this._exposes,\n )}`;\n }\n /**\n * @param {RequestShortener} requestShortener the request shortener\n * @returns {string} a user readable identifier of the module\n */\n override readableIdentifier(requestShortener: RequestShortener): string {\n return 'container entry';\n }\n /**\n * @param {LibIdentOptions} options options\n * @returns {string | null} an identifier for library inclusion\n */\n override libIdent(options: LibIdentOptions): string | null {\n return `${this.layer ? `(${this.layer})/` : ''}webpack/container/entry/${\n this._name\n }`;\n }\n /**\n * @param {NeedBuildContext} context context info\n * @param {function((WebpackError | null)=, boolean=): void} callback callback function, returns true, if the module needs a rebuild\n * @returns {void}\n */\n override needBuild(\n context: NeedBuildContext,\n callback: (\n arg0: (WebpackError | null) | undefined,\n arg1: boolean | undefined,\n ) => void,\n ): void {\n const baseContext = context as NeedBuildContext;\n callback(null, !this.buildMeta);\n }\n /**\n * @param {WebpackOptions} options webpack options\n * @param {Compilation} compilation the compilation\n * @param {ResolverWithOptions} resolver the resolver\n * @param {InputFileSystem} fs the file system\n * @param {function(WebpackError): void} callback callback function\n * @returns {void}\n */\n override build(\n options: WebpackOptions,\n compilation: Compilation,\n resolver: ResolverWithOptions,\n fs: InputFileSystem,\n callback: (err?: WebpackError) => void,\n ): void {\n this.buildMeta = {};\n this.buildInfo = {\n strict: true,\n topLevelDeclarations: new Set(['moduleMap', 'get', 'init']),\n };\n this.buildMeta.exportsType = 'namespace';\n //@ts-ignore\n this.clearDependenciesAndBlocks();\n\n for (const [name, options] of this._exposes) {\n const block = new AsyncDependenciesBlock(\n {\n name: options.name,\n },\n { name },\n options.import[options.import.length - 1],\n );\n let idx = 0;\n for (const request of options.import) {\n const dep = new ContainerExposedDependency(name, request);\n dep.loc = {\n name,\n index: idx++,\n };\n //@ts-ignore\n block.addDependency(dep);\n }\n //@ts-ignore\n this.addBlock(block);\n }\n //@ts-ignore\n this.addDependency(\n //@ts-ignore\n new StaticExportsDependency(\n ['get', 'init'],\n false,\n ) as unknown as Dependency,\n );\n\n callback();\n }\n\n /**\n * @param {CodeGenerationContext} context context for code generation\n * @returns {CodeGenerationResult} result\n */\n //@ts-ignore\n override codeGeneration({ moduleGraph, chunkGraph, runtimeTemplate }) {\n const sources = new Map();\n const runtimeRequirements = new Set([\n RuntimeGlobals.definePropertyGetters,\n RuntimeGlobals.hasOwnProperty,\n RuntimeGlobals.exports,\n ]);\n const getters = [];\n //@ts-ignore\n for (const block of this.blocks) {\n const { dependencies } = block;\n\n const modules = dependencies.map((dependency: Dependency) => {\n const dep = dependency as unknown as ContainerExposedDependency;\n return {\n name: dep.exposedName,\n module: moduleGraph.getModule(dep),\n request: dep.userRequest,\n };\n });\n\n let str;\n //@ts-ignore\n if (modules.some((m) => !m.module)) {\n str = runtimeTemplate.throwMissingModuleErrorBlock({\n //@ts-ignore\n request: modules.map((m) => m.request).join(', '),\n });\n } else {\n str = `return ${runtimeTemplate.blockPromise({\n block,\n message: '',\n chunkGraph,\n runtimeRequirements,\n })}.then(${runtimeTemplate.returningFunction(\n runtimeTemplate.returningFunction(\n `(${modules\n //@ts-ignore\n .map(({ module, request }) =>\n runtimeTemplate.moduleRaw({\n module,\n chunkGraph,\n request,\n weak: false,\n runtimeRequirements,\n }),\n )\n .join(', ')})`,\n ),\n )});`;\n }\n\n getters.push(\n `${JSON.stringify(modules[0].name)}: ${runtimeTemplate.basicFunction(\n '',\n str,\n )}`,\n );\n }\n\n const source = Template.asString([\n `var moduleMap = {`,\n Template.indent(getters.join(',\\n')),\n '};',\n `var get = ${runtimeTemplate.basicFunction('module, getScope', [\n `${RuntimeGlobals.currentRemoteGetScope} = getScope;`,\n // reusing the getScope variable to avoid creating a new var (and module is also used later)\n 'getScope = (',\n Template.indent([\n `${RuntimeGlobals.hasOwnProperty}(moduleMap, module)`,\n Template.indent([\n '? moduleMap[module]()',\n `: Promise.resolve().then(${runtimeTemplate.basicFunction(\n '',\n \"throw new Error('Module \\\"' + module + '\\\" does not exist in container.');\",\n )})`,\n ]),\n ]),\n ');',\n `${RuntimeGlobals.currentRemoteGetScope} = undefined;`,\n 'return getScope;',\n ])};`,\n `var init = ${runtimeTemplate.basicFunction('shareScope, initScope', [\n `if (!${RuntimeGlobals.shareScopeMap}) return;`,\n `var name = ${JSON.stringify(this._shareScope)}`,\n `var oldScope = ${RuntimeGlobals.shareScopeMap}[name];`,\n `if(oldScope && oldScope !== shareScope) throw new Error(\"Container initialization failed as it has already been initialized with a different share scope\");`,\n `${RuntimeGlobals.shareScopeMap}[name] = shareScope;`,\n `return ${RuntimeGlobals.initializeSharing}(name, initScope);`,\n ])};`,\n '',\n '// This exports getters to disallow modifications',\n `${RuntimeGlobals.definePropertyGetters}(exports, {`,\n Template.indent([\n `get: ${runtimeTemplate.returningFunction('get')},`,\n `init: ${runtimeTemplate.returningFunction('init')}`,\n ]),\n '});',\n ]);\n\n sources.set(\n 'javascript',\n this.useSourceMap || this.useSimpleSourceMap\n ? new OriginalSource(source, 'webpack/container-entry')\n : new RawSource(source),\n );\n\n return {\n sources,\n runtimeRequirements,\n };\n }\n\n /**\n * @param {string=} type the source type for which the size should be estimated\n * @returns {number} the estimated size of the module (must be non-zero)\n */\n override size(type?: string): number {\n return 42;\n }\n /**\n * @param {ObjectSerializerContext} context context\n */\n //@ts-ignore\n override serialize(context: ObjectSerializerContext): void {\n const { write } = context;\n write(this._name);\n write(this._exposes);\n write(this._shareScope);\n //@ts-ignore\n super.serialize(context);\n }\n}\n//@ts-ignore\nmakeSerializable(\n ContainerEntryModule,\n 'enhanced/lib/container/ContainerEntryModule',\n);\n\nexport default ContainerEntryModule;\n"],"names":["SOURCE_TYPES","Set","ContainerEntryModule","Module","deserialize","context","read","obj","getSourceTypes","identifier","_shareScope","JSON","stringify","_exposes","readableIdentifier","requestShortener","libIdent","options","layer","_name","needBuild","callback","baseContext","buildMeta","build","compilation","resolver","fs","buildInfo","strict","topLevelDeclarations","exportsType","clearDependenciesAndBlocks","name","block","AsyncDependenciesBlock","import","length","idx","request","dep","ContainerExposedDependency","loc","index","addDependency","addBlock","StaticExportsDependency","codeGeneration","moduleGraph","chunkGraph","runtimeTemplate","sources","Map","runtimeRequirements","RuntimeGlobals","definePropertyGetters","hasOwnProperty","exports","getters","blocks","dependencies","modules","map","dependency","exposedName","module","getModule","userRequest","str","some","m","throwMissingModuleErrorBlock","join","blockPromise","message","returningFunction","moduleRaw","weak","push","basicFunction","source","Template","asString","indent","currentRemoteGetScope","shareScopeMap","initializeSharing","set","useSourceMap","useSimpleSourceMap","OriginalSource","RawSource","size","type","serialize","write","constructor","exposes","shareScope","JAVASCRIPT_MODULE_TYPE_DYNAMIC","makeSerializable"],"mappings":"AAAA;;;AAGA,GAEA;;;;+BA0TA;;;eAAA;;;+EAzTmC;iEAEd;+DACF;wEACa;gCACU;qCACK;mFACR;gFACH;yEAaP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7B,MAAMA,eAAe,IAAIC,IAAI;IAAC;CAAa;AAa3C,IAAA,AAAMC,uBAAN,MAAMA,6BAA6BC,eAAM;IAmBvC;;;GAGC,GACD,OAAOC,YAAYC,OAAkC,EAAwB;QAC3E,MAAM,EAAEC,IAAI,EAAE,GAAGD;QACjB,MAAME,MAAM,IAAIL,qBAAqBI,QAAQA,QAAQA;QACrD,YAAY;QACZC,IAAIH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AA4PF;AACA,YAAY;AACZE,IAAAA,yBAAgB,EACdlG,sBACA;MAGF,WAAeA"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/ContainerEntryModule.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy, Marais Rossouw @maraisr\n*/\n\n'use strict';\nimport AsyncDependenciesBlock from 'webpack/lib/AsyncDependenciesBlock';\nimport Dependency from 'webpack/lib/Dependency';\nimport Template from 'webpack/lib/Template';\nimport Module from 'webpack/lib/Module';\nimport * as RuntimeGlobals from 'webpack/lib/RuntimeGlobals';\nimport { OriginalSource, RawSource } from 'webpack-sources';\nimport { JAVASCRIPT_MODULE_TYPE_DYNAMIC } from 'webpack/lib/ModuleTypeConstants';\nimport ContainerExposedDependency from './ContainerExposedDependency';\nimport StaticExportsDependency from 'webpack/lib/dependencies/StaticExportsDependency';\nimport type Compilation from 'webpack/lib/Compilation';\nimport type {\n LibIdentOptions,\n NeedBuildContext,\n RequestShortener,\n ObjectDeserializerContext,\n ObjectSerializerContext,\n WebpackOptions,\n InputFileSystem,\n ResolverWithOptions,\n} from 'webpack/lib/Module';\nimport type WebpackError from 'webpack/lib/WebpackError';\nimport makeSerializable from 'webpack/lib/util/makeSerializable';\n\nconst SOURCE_TYPES = new Set(['javascript']);\n\nexport type ExposeOptions = {\n /**\n * requests to exposed modules (last one is exported)\n */\n import: string[];\n /**\n * custom chunk name for the exposed module\n */\n name: string;\n};\n\nclass ContainerEntryModule extends Module {\n private _name: string;\n private _exposes: [string, ExposeOptions][];\n private _shareScope: string;\n /**\n * @param {string} name container entry name\n * @param {[string, ExposeOptions][]} exposes list of exposed modules\n * @param {string} shareScope name of the share scope\n */\n constructor(\n name: string,\n exposes: [string, ExposeOptions][],\n shareScope: string,\n ) {\n super(JAVASCRIPT_MODULE_TYPE_DYNAMIC, null);\n this._name = name;\n this._exposes = exposes;\n this._shareScope = shareScope;\n }\n /**\n * @param {ObjectDeserializerContext} context context\n * @returns {ContainerEntryModule} deserialized container entry module\n */\n static deserialize(context: ObjectDeserializerContext): ContainerEntryModule {\n const { read } = context;\n const obj = new ContainerEntryModule(read(), read(), read());\n //@ts-ignore\n obj.deserialize(context);\n return obj;\n }\n\n /**\n * @returns {Set<string>} types available (do not mutate)\n */\n override getSourceTypes(): Set<string> {\n return SOURCE_TYPES;\n }\n /**\n * @returns {string} a unique identifier of the module\n */\n override identifier(): string {\n return `container entry (${this._shareScope}) ${JSON.stringify(\n this._exposes,\n )}`;\n }\n /**\n * @param {RequestShortener} requestShortener the request shortener\n * @returns {string} a user readable identifier of the module\n */\n override readableIdentifier(requestShortener: RequestShortener): string {\n return 'container entry';\n }\n /**\n * @param {LibIdentOptions} options options\n * @returns {string | null} an identifier for library inclusion\n */\n override libIdent(options: LibIdentOptions): string | null {\n return `${this.layer ? `(${this.layer})/` : ''}webpack/container/entry/${\n this._name\n }`;\n }\n /**\n * @param {NeedBuildContext} context context info\n * @param {function((WebpackError | null)=, boolean=): void} callback callback function, returns true, if the module needs a rebuild\n * @returns {void}\n */\n override needBuild(\n context: NeedBuildContext,\n callback: (\n arg0: (WebpackError | null) | undefined,\n arg1: boolean | undefined,\n ) => void,\n ): void {\n const baseContext = context as NeedBuildContext;\n callback(null, !this.buildMeta);\n }\n /**\n * @param {WebpackOptions} options webpack options\n * @param {Compilation} compilation the compilation\n * @param {ResolverWithOptions} resolver the resolver\n * @param {InputFileSystem} fs the file system\n * @param {function(WebpackError): void} callback callback function\n * @returns {void}\n */\n override build(\n options: WebpackOptions,\n compilation: Compilation,\n resolver: ResolverWithOptions,\n fs: InputFileSystem,\n callback: (err?: WebpackError) => void,\n ): void {\n this.buildMeta = {};\n this.buildInfo = {\n strict: true,\n topLevelDeclarations: new Set(['moduleMap', 'get', 'init']),\n };\n this.buildMeta.exportsType = 'namespace';\n //@ts-ignore\n this.clearDependenciesAndBlocks();\n\n for (const [name, options] of this._exposes) {\n const block = new AsyncDependenciesBlock(\n {\n name: options.name,\n },\n { name },\n options.import[options.import.length - 1],\n );\n let idx = 0;\n for (const request of options.import) {\n const dep = new ContainerExposedDependency(name, request);\n dep.loc = {\n name,\n index: idx++,\n };\n //@ts-ignore\n block.addDependency(dep);\n }\n //@ts-ignore\n this.addBlock(block);\n }\n //@ts-ignore\n this.addDependency(\n //@ts-ignore\n new StaticExportsDependency(\n ['get', 'init'],\n false,\n ) as unknown as Dependency,\n );\n\n callback();\n }\n\n /**\n * @param {CodeGenerationContext} context context for code generation\n * @returns {CodeGenerationResult} result\n */\n //@ts-ignore\n override codeGeneration({ moduleGraph, chunkGraph, runtimeTemplate }) {\n const sources = new Map();\n const runtimeRequirements = new Set([\n RuntimeGlobals.definePropertyGetters,\n RuntimeGlobals.hasOwnProperty,\n RuntimeGlobals.exports,\n ]);\n const getters = [];\n //@ts-ignore\n for (const block of this.blocks) {\n const { dependencies } = block;\n\n const modules = dependencies.map((dependency: Dependency) => {\n const dep = dependency as unknown as ContainerExposedDependency;\n return {\n name: dep.exposedName,\n module: moduleGraph.getModule(dep),\n request: dep.userRequest,\n };\n });\n\n let str;\n //@ts-ignore\n if (modules.some((m) => !m.module)) {\n str = runtimeTemplate.throwMissingModuleErrorBlock({\n //@ts-ignore\n request: modules.map((m) => m.request).join(', '),\n });\n } else {\n str = `return ${runtimeTemplate.blockPromise({\n block,\n message: '',\n chunkGraph,\n runtimeRequirements,\n })}.then(${runtimeTemplate.returningFunction(\n runtimeTemplate.returningFunction(\n `(${modules\n //@ts-ignore\n .map(({ module, request }) =>\n runtimeTemplate.moduleRaw({\n module,\n chunkGraph,\n request,\n weak: false,\n runtimeRequirements,\n }),\n )\n .join(', ')})`,\n ),\n )});`;\n }\n\n getters.push(\n `${JSON.stringify(modules[0].name)}: ${runtimeTemplate.basicFunction(\n '',\n str,\n )}`,\n );\n }\n\n const source = Template.asString([\n `var moduleMap = {`,\n Template.indent(getters.join(',\\n')),\n '};',\n `var get = ${runtimeTemplate.basicFunction('module, getScope', [\n `${RuntimeGlobals.currentRemoteGetScope} = getScope;`,\n // reusing the getScope variable to avoid creating a new var (and module is also used later)\n 'getScope = (',\n Template.indent([\n `${RuntimeGlobals.hasOwnProperty}(moduleMap, module)`,\n Template.indent([\n '? moduleMap[module]()',\n `: Promise.resolve().then(${runtimeTemplate.basicFunction(\n '',\n \"throw new Error('Module \\\"' + module + '\\\" does not exist in container.');\",\n )})`,\n ]),\n ]),\n ');',\n `${RuntimeGlobals.currentRemoteGetScope} = undefined;`,\n 'return getScope;',\n ])};`,\n `var init = ${runtimeTemplate.basicFunction('shareScope, initScope', [\n `if (!${RuntimeGlobals.shareScopeMap}) return;`,\n `var name = ${JSON.stringify(this._shareScope)}`,\n `var oldScope = ${RuntimeGlobals.shareScopeMap}[name];`,\n `if(oldScope && oldScope !== shareScope) throw new Error(\"Container initialization failed as it has already been initialized with a different share scope\");`,\n `${RuntimeGlobals.shareScopeMap}[name] = shareScope;`,\n `return ${RuntimeGlobals.initializeSharing}(name, initScope);`,\n ])};`,\n '',\n '// This exports getters to disallow modifications',\n `${RuntimeGlobals.definePropertyGetters}(exports, {`,\n Template.indent([\n `get: ${runtimeTemplate.returningFunction('get')},`,\n `init: ${runtimeTemplate.returningFunction('init')}`,\n ]),\n '});',\n ]);\n\n sources.set(\n 'javascript',\n this.useSourceMap || this.useSimpleSourceMap\n ? new OriginalSource(source, 'webpack/container-entry')\n : new RawSource(source),\n );\n\n return {\n sources,\n runtimeRequirements,\n };\n }\n\n /**\n * @param {string=} type the source type for which the size should be estimated\n * @returns {number} the estimated size of the module (must be non-zero)\n */\n override size(type?: string): number {\n return 42;\n }\n /**\n * @param {ObjectSerializerContext} context context\n */\n //@ts-ignore\n override serialize(context: ObjectSerializerContext): void {\n const { write } = context;\n write(this._name);\n write(this._exposes);\n write(this._shareScope);\n //@ts-ignore\n super.serialize(context);\n }\n}\n//@ts-ignore\nmakeSerializable(\n ContainerEntryModule,\n 'enhanced/lib/container/ContainerEntryModule',\n);\n\nexport default ContainerEntryModule;\n"],"names":["SOURCE_TYPES","Set","ContainerEntryModule","Module","deserialize","context","read","obj","getSourceTypes","identifier","_shareScope","JSON","stringify","_exposes","readableIdentifier","requestShortener","libIdent","options","layer","_name","needBuild","callback","baseContext","buildMeta","build","compilation","resolver","fs","buildInfo","strict","topLevelDeclarations","exportsType","clearDependenciesAndBlocks","name","block","AsyncDependenciesBlock","import","length","idx","request","dep","ContainerExposedDependency","loc","index","addDependency","addBlock","StaticExportsDependency","codeGeneration","moduleGraph","chunkGraph","runtimeTemplate","sources","Map","runtimeRequirements","RuntimeGlobals","definePropertyGetters","hasOwnProperty","exports","getters","blocks","dependencies","modules","map","dependency","exposedName","module","getModule","userRequest","str","some","m","throwMissingModuleErrorBlock","join","blockPromise","message","returningFunction","moduleRaw","weak","push","basicFunction","source","Template","asString","indent","currentRemoteGetScope","shareScopeMap","initializeSharing","set","useSourceMap","useSimpleSourceMap","OriginalSource","RawSource","size","type","serialize","write","constructor","exposes","shareScope","JAVASCRIPT_MODULE_TYPE_DYNAMIC","makeSerializable"],"mappings":"AAAA;;;AAGA,GAEA;;;;+BA0TA;;;eAAA;;;+EAzTmC;iEAEd;+DACF;wEACa;gCACU;qCACK;mFACR;gFACH;yEAaP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7B,MAAMA,eAAe,IAAIC,IAAI;IAAC;CAAa;AAa3C,IAAA,AAAMC,uBAAN,MAAMA,6BAA6BC,eAAM;IAmBvC;;;GAGC,GACD,OAAOC,YAAYC,OAAkC,EAAwB;QAC3E,MAAM,EAAEC,IAAI,EAAE,GAAGD;QACjB,MAAME,MAAM,IAAIL,qBAAqBI,QAAQA,QAAQA;QACrD,YAAY;QACZC,IAAIH,WAAW,CAACC;QAChB,OAAOE;IACT;IAEA;;GAEC,GACD,AAASC,iBAA8B;QACrC,OAAOR;IACT;IACA;;GAEC,GACD,AAASS,aAAqB;QAC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