@module-federation/node 2.5.16 → 2.5.17
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 +18 -20
- package/dist/package.json +7 -6
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -35,9 +35,10 @@ yarn add @module-federation/node
|
|
|
35
35
|
## 🚀 Usage
|
|
36
36
|
|
|
37
37
|
There are two approaches to using the plugins exported from this package, dependent on your use case.
|
|
38
|
+
|
|
38
39
|
### Use as Runtime Plugin
|
|
39
40
|
|
|
40
|
-
`module-federation/enhanced` supports runtime plugins.
|
|
41
|
+
`module-federation/enhanced` supports runtime plugins.
|
|
41
42
|
|
|
42
43
|
```js
|
|
43
44
|
const { ModuleFederationPlugin } = require('@module-federation/enhanced');
|
|
@@ -45,40 +46,37 @@ const { ModuleFederationPlugin } = require('@module-federation/enhanced');
|
|
|
45
46
|
const options = {
|
|
46
47
|
target: 'async-node',
|
|
47
48
|
output: {
|
|
48
|
-
chunkFilename: '[id]-[chunkhash].js' // important to hash chunks
|
|
49
|
+
chunkFilename: '[id]-[chunkhash].js', // important to hash chunks
|
|
49
50
|
},
|
|
50
51
|
plugins: [
|
|
51
52
|
new ModuleFederationPlugin({
|
|
52
53
|
name: 'app1',
|
|
53
54
|
exposes: {},
|
|
54
55
|
remotes: {
|
|
55
|
-
app2: 'app2@http://'
|
|
56
|
+
app2: 'app2@http://',
|
|
56
57
|
},
|
|
57
|
-
runtimePlugins: [
|
|
58
|
-
require.resolve('@module-federation/node/runtimePlugin')
|
|
59
|
-
],
|
|
58
|
+
runtimePlugins: [require.resolve('@module-federation/node/runtimePlugin')],
|
|
60
59
|
remoteType: 'script',
|
|
61
|
-
library: { type: 'commonjs-module', name: 'app1' }
|
|
62
|
-
})
|
|
63
|
-
]
|
|
60
|
+
library: { type: 'commonjs-module', name: 'app1' },
|
|
61
|
+
}),
|
|
62
|
+
],
|
|
64
63
|
};
|
|
65
|
-
|
|
66
64
|
```
|
|
67
65
|
|
|
68
66
|
or you can enable it with some presets via UniversalFederation
|
|
69
67
|
|
|
70
68
|
```js
|
|
71
69
|
new UniversalFederationPlugin({
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
70
|
+
name: 'website2',
|
|
71
|
+
library: { type: 'commonjs-module' },
|
|
72
|
+
isServer: true, // or false
|
|
73
|
+
remotes: {},
|
|
74
|
+
filename: 'remoteEntry.js',
|
|
75
|
+
useRuntimePlugin: true, // uses the module-federation/enhanced runtime plugin api
|
|
76
|
+
exposes: {
|
|
77
|
+
'./SharedComponent': './remoteServer/SharedComponent',
|
|
78
|
+
},
|
|
79
|
+
});
|
|
82
80
|
```
|
|
83
81
|
|
|
84
82
|
### UniversalFederationPlugin
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"public": true,
|
|
3
3
|
"name": "@module-federation/node",
|
|
4
|
-
"version": "2.5.
|
|
4
|
+
"version": "2.5.17",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -106,11 +106,12 @@
|
|
|
106
106
|
"vue": "3.5.6",
|
|
107
107
|
"webpack-sources": "3.2.3",
|
|
108
108
|
"ws": "8.17.1",
|
|
109
|
-
"@module-federation/
|
|
110
|
-
"@module-federation/
|
|
111
|
-
"@module-federation/
|
|
112
|
-
"@module-federation/
|
|
113
|
-
"@module-federation/
|
|
109
|
+
"@module-federation/data-prefetch": "0.6.7",
|
|
110
|
+
"@module-federation/dts-plugin": "0.6.7",
|
|
111
|
+
"@module-federation/managers": "0.6.7",
|
|
112
|
+
"@module-federation/manifest": "0.6.7",
|
|
113
|
+
"@module-federation/rspack": "0.6.7",
|
|
114
|
+
"@module-federation/third-party-dts-extractor": "0.6.7"
|
|
114
115
|
},
|
|
115
116
|
"peerDependencies": {
|
|
116
117
|
"react": "^16||^17||^18",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"public": true,
|
|
3
3
|
"name": "@module-federation/node",
|
|
4
|
-
"version": "2.5.
|
|
4
|
+
"version": "2.5.17",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./dist/src/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"btoa": "1.2.1",
|
|
65
65
|
"encoding": "^0.1.13",
|
|
66
66
|
"node-fetch": "2.7.0",
|
|
67
|
-
"@module-federation/enhanced": "0.6.
|
|
68
|
-
"@module-federation/sdk": "0.6.
|
|
69
|
-
"@module-federation/utilities": "3.1.
|
|
70
|
-
"@module-federation/runtime": "0.6.
|
|
67
|
+
"@module-federation/enhanced": "0.6.7",
|
|
68
|
+
"@module-federation/sdk": "0.6.7",
|
|
69
|
+
"@module-federation/utilities": "3.1.13",
|
|
70
|
+
"@module-federation/runtime": "0.6.7"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"react": "^16||^17||^18",
|