@module-federation/rspack 0.1.21 → 0.2.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/dist/index.cjs.js CHANGED
@@ -6,6 +6,15 @@ var sdk = require('@module-federation/sdk');
6
6
  var manifest = require('@module-federation/manifest');
7
7
  var managers = require('@module-federation/managers');
8
8
  var dtsPlugin = require('@module-federation/dts-plugin');
9
+ var ReactBridgePlugin = require('@module-federation/bridge-react-webpack-plugin');
10
+ var path = require('node:path');
11
+ var fs = require('node:fs');
12
+
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
+
15
+ var ReactBridgePlugin__default = /*#__PURE__*/_interopDefaultLegacy(ReactBridgePlugin);
16
+ var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
17
+ var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
9
18
 
10
19
  function _class_call_check(instance, Constructor) {
11
20
  if (!(instance instanceof Constructor)) {
@@ -164,10 +173,19 @@ var ModuleFederationPlugin = /*#__PURE__*/ function() {
164
173
  });
165
174
  if (!disableManifest) {
166
175
  new manifest.StatsPlugin(options, {
167
- pluginVersion: "0.1.21",
176
+ pluginVersion: "0.2.1",
168
177
  bundler: 'rspack'
169
178
  }).apply(compiler);
170
179
  }
180
+ // react bridge plugin
181
+ var nodeModulesPath = path__default["default"].resolve(compiler.context, 'node_modules');
182
+ var reactPath = path__default["default"].join(nodeModulesPath, '@module-federation/bridge-react');
183
+ // Check whether react exists
184
+ if (fs__default["default"].existsSync(reactPath)) {
185
+ new ReactBridgePlugin__default["default"]({
186
+ moduleFederationOptions: this._options
187
+ }).apply(compiler);
188
+ }
171
189
  }
172
190
  },
173
191
  {
package/dist/index.esm.js CHANGED
@@ -2,6 +2,9 @@ import { composeKeyWithSeparator } from '@module-federation/sdk';
2
2
  import { StatsPlugin } from '@module-federation/manifest';
3
3
  import { utils, ContainerManager } from '@module-federation/managers';
4
4
  import { DtsPlugin } from '@module-federation/dts-plugin';
5
+ import ReactBridgePlugin from '@module-federation/bridge-react-webpack-plugin';
6
+ import path from 'node:path';
7
+ import fs from 'node:fs';
5
8
 
6
9
  function _class_call_check(instance, Constructor) {
7
10
  if (!(instance instanceof Constructor)) {
@@ -160,10 +163,19 @@ var ModuleFederationPlugin = /*#__PURE__*/ function() {
160
163
  });
161
164
  if (!disableManifest) {
162
165
  new StatsPlugin(options, {
163
- pluginVersion: "0.1.21",
166
+ pluginVersion: "0.2.1",
164
167
  bundler: 'rspack'
165
168
  }).apply(compiler);
166
169
  }
170
+ // react bridge plugin
171
+ var nodeModulesPath = path.resolve(compiler.context, 'node_modules');
172
+ var reactPath = path.join(nodeModulesPath, '@module-federation/bridge-react');
173
+ // Check whether react exists
174
+ if (fs.existsSync(reactPath)) {
175
+ new ReactBridgePlugin({
176
+ moduleFederationOptions: this._options
177
+ }).apply(compiler);
178
+ }
167
179
  }
168
180
  },
169
181
  {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/rspack",
3
- "version": "0.1.21",
3
+ "version": "0.2.1",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "Module Federation",
@@ -20,6 +20,7 @@
20
20
  "types": "./dist/index.cjs.d.ts",
21
21
  "dependencies": {
22
22
  "@module-federation/sdk": "workspace:*",
23
+ "@module-federation/bridge-react-webpack-plugin": "workspace:*",
23
24
  "@module-federation/runtime-tools": "workspace:*",
24
25
  "@module-federation/manifest": "workspace:*",
25
26
  "@module-federation/managers": "workspace:*",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/rspack",
3
- "version": "0.1.21",
3
+ "version": "0.2.1",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "Module Federation",
@@ -19,11 +19,12 @@
19
19
  "module": "./dist/index.esm.js",
20
20
  "types": "./dist/index.cjs.d.ts",
21
21
  "dependencies": {
22
- "@module-federation/sdk": "0.1.21",
23
- "@module-federation/runtime-tools": "0.1.21",
24
- "@module-federation/manifest": "0.1.21",
25
- "@module-federation/managers": "0.1.21",
26
- "@module-federation/dts-plugin": "0.1.21"
22
+ "@module-federation/sdk": "0.2.1",
23
+ "@module-federation/bridge-react-webpack-plugin": "0.2.1",
24
+ "@module-federation/runtime-tools": "0.2.1",
25
+ "@module-federation/manifest": "0.2.1",
26
+ "@module-federation/managers": "0.2.1",
27
+ "@module-federation/dts-plugin": "0.2.1"
27
28
  },
28
29
  "devDependencies": {
29
30
  "@rspack/core": "0.5.0"