@module-federation/webpack-bundler-runtime 0.0.0-next-20240105131424 → 0.0.0-next-20240108071116

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1 +1,23 @@
1
1
  # `@module-federation/webpack-bundler-runtime`
2
+
3
+ - Extract the build runtime and combine it with the internal runtime
4
+ - Used with webpack/rspack
5
+
6
+ ## Usage
7
+
8
+ The package needs to be used with webpack/rspack bundler. It will export federation object which includes runtime, instance, bundlerRuntime, initOptions, attachShareScopeMap, bundlerRuntimeOptions.
9
+
10
+ After referencing, mount it to the corresponding bundler runtime, and then use the corresponding api/instance.
11
+
12
+ * example
13
+
14
+ ```ts
15
+ import federation from '@module-federation/webpack-bundler-runtime';
16
+
17
+ __webpack_require__.federation = federation;
18
+
19
+ __webpack_require__.f.remotes = __webpack_require__.federation.remotes(options)
20
+ __webpack_require__.f.consumes = __webpack_require__.federation.remotes(options)
21
+ ```
22
+
23
+
package/dist/index.cjs.js CHANGED
@@ -189,7 +189,8 @@ function initializeSharing(param) {
189
189
  var module = webpackRequire(id);
190
190
  if (!module) return;
191
191
  var initFn = function(module) {
192
- return module && module.init && module.init(webpackRequire.S[shareScopeName], initScope);
192
+ return module && module.init && // @ts-ignore compat legacy mf shared behavior
193
+ module.init(webpackRequire.S[shareScopeName], initScope);
193
194
  };
194
195
  if (module.then) return promises.push(module.then(initFn, handleError));
195
196
  var initResult = initFn(module);
package/dist/index.esm.js CHANGED
@@ -167,7 +167,8 @@ function initializeSharing(param) {
167
167
  var module = webpackRequire(id);
168
168
  if (!module) return;
169
169
  var initFn = function(module) {
170
- return module && module.init && module.init(webpackRequire.S[shareScopeName], initScope);
170
+ return module && module.init && // @ts-ignore compat legacy mf shared behavior
171
+ module.init(webpackRequire.S[shareScopeName], initScope);
171
172
  };
172
173
  if (module.then) return promises.push(module.then(initFn, handleError));
173
174
  var initResult = initFn(module);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "@module-federation/webpack-bundler-runtime",
4
- "version": "0.0.0-next-20240105131424",
4
+ "version": "0.0.0-next-20240108071116",
5
5
  "license": "MIT",
6
6
  "description": "Module Federation Runtime for webpack",
7
7
  "keywords": [
@@ -20,8 +20,8 @@
20
20
  "module": "./dist/index.esm.js",
21
21
  "types": "./dist/index.cjs.d.ts",
22
22
  "dependencies": {
23
- "@module-federation/runtime": "0.0.0-next-20240105131424",
24
- "@module-federation/sdk": "0.0.0-next-20240105131424"
23
+ "@module-federation/runtime": "0.0.0-next-20240108071116",
24
+ "@module-federation/sdk": "0.0.0-next-20240108071116"
25
25
  },
26
26
  "exports": {
27
27
  ".": {
@@ -1,2 +0,0 @@
1
- import { WebpackRequire } from './types';
2
- export declare function proxyShareScopeMap(__webpack_require__: WebpackRequire): void;