@module-federation/rspack 0.0.0-next-20250926024003 → 0.0.0-perf-devtools-20260106124142
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/RemoteEntryPlugin.cjs.js +70 -0
- package/dist/RemoteEntryPlugin.cjs.js.map +1 -0
- package/dist/RemoteEntryPlugin.esm.mjs +67 -0
- package/dist/RemoteEntryPlugin.esm.mjs.map +1 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.mjs +2 -2
- package/dist/index.esm.mjs.map +1 -1
- package/dist/plugin.cjs.js +236 -266
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.esm.mjs +237 -267
- package/dist/plugin.esm.mjs.map +1 -1
- package/dist/remote-entry-plugin.cjs.js +4 -91
- package/dist/remote-entry-plugin.cjs.js.map +1 -1
- package/dist/remote-entry-plugin.esm.mjs +3 -94
- package/dist/remote-entry-plugin.esm.mjs.map +1 -1
- package/dist/src/ModuleFederationPlugin.d.ts +0 -1
- package/dist/src/logger.d.ts +2 -1
- package/package.json +8 -8
|
@@ -1,97 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
3
|
+
require('btoa');
|
|
4
|
+
require('@module-federation/managers');
|
|
5
|
+
var remoteEntryPlugin = require('./RemoteEntryPlugin.cjs.js');
|
|
6
6
|
|
|
7
|
-
var logger = sdk.createLogger('[ Module Federation Rspack Plugin ]');
|
|
8
7
|
|
|
9
|
-
function _class_call_check(instance, Constructor) {
|
|
10
|
-
if (!(instance instanceof Constructor)) {
|
|
11
|
-
throw new TypeError("Cannot call a class as a function");
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
function _defineProperties(target, props) {
|
|
15
|
-
for(var i = 0; i < props.length; i++){
|
|
16
|
-
var descriptor = props[i];
|
|
17
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
18
|
-
descriptor.configurable = true;
|
|
19
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
20
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
24
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
25
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
26
|
-
return Constructor;
|
|
27
|
-
}
|
|
28
|
-
// @ts-ignore
|
|
29
|
-
var charMap = {
|
|
30
|
-
'<': '\\u003C',
|
|
31
|
-
'>': '\\u003E',
|
|
32
|
-
'/': '\\u002F',
|
|
33
|
-
'\\': '\\\\',
|
|
34
|
-
'\b': '\\b',
|
|
35
|
-
'\f': '\\f',
|
|
36
|
-
'\n': '\\n',
|
|
37
|
-
'\r': '\\r',
|
|
38
|
-
'\t': '\\t',
|
|
39
|
-
'\0': '\\0',
|
|
40
|
-
'\u2028': '\\u2028',
|
|
41
|
-
'\u2029': '\\u2029'
|
|
42
|
-
};
|
|
43
|
-
function escapeUnsafeChars(str) {
|
|
44
|
-
return str.replace(/[<>\b\f\n\r\t\0\u2028\u2029\\]/g, function(x) {
|
|
45
|
-
return charMap[x];
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
var RemoteEntryPlugin = /*#__PURE__*/ function() {
|
|
49
|
-
function RemoteEntryPlugin(options) {
|
|
50
|
-
_class_call_check(this, RemoteEntryPlugin);
|
|
51
|
-
this.name = 'VmokRemoteEntryPlugin';
|
|
52
|
-
this._options = options;
|
|
53
|
-
}
|
|
54
|
-
_create_class(RemoteEntryPlugin, [
|
|
55
|
-
{
|
|
56
|
-
key: "apply",
|
|
57
|
-
value: function apply(compiler) {
|
|
58
|
-
var _this__options = this._options, name = _this__options.name, getPublicPath = _this__options.getPublicPath;
|
|
59
|
-
if (!getPublicPath || !name) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
var containerManager = new managers.ContainerManager();
|
|
63
|
-
containerManager.init(this._options);
|
|
64
|
-
if (!containerManager.enable) {
|
|
65
|
-
logger.warn("Detect you don't set exposes, 'getPublicPath' will not have effect.");
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
RemoteEntryPlugin.addPublicPathEntry(compiler, getPublicPath, name);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
], [
|
|
72
|
-
{
|
|
73
|
-
key: "addPublicPathEntry",
|
|
74
|
-
value: function addPublicPathEntry(compiler, getPublicPath, name) {
|
|
75
|
-
var code;
|
|
76
|
-
var sanitizedPublicPath = escapeUnsafeChars(getPublicPath);
|
|
77
|
-
if (!getPublicPath.startsWith('function')) {
|
|
78
|
-
code = "".concat(compiler.webpack.RuntimeGlobals.publicPath, " = new Function(").concat(JSON.stringify(sanitizedPublicPath), ")()");
|
|
79
|
-
} else {
|
|
80
|
-
code = "(".concat(sanitizedPublicPath, "())");
|
|
81
|
-
}
|
|
82
|
-
var base64Code = pBtoa(code);
|
|
83
|
-
var dataUrl = "data:text/javascript;base64,".concat(base64Code);
|
|
84
|
-
compiler.hooks.afterPlugins.tap('VmokRemoteEntryPlugin', function() {
|
|
85
|
-
new compiler.webpack.EntryPlugin(compiler.context, dataUrl, {
|
|
86
|
-
name: name
|
|
87
|
-
}).apply(compiler);
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
]);
|
|
92
|
-
return RemoteEntryPlugin;
|
|
93
|
-
}
|
|
94
|
-
();
|
|
95
8
|
|
|
96
|
-
exports.RemoteEntryPlugin = RemoteEntryPlugin;
|
|
9
|
+
exports.RemoteEntryPlugin = remoteEntryPlugin.RemoteEntryPlugin;
|
|
97
10
|
//# sourceMappingURL=remote-entry-plugin.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-entry-plugin.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote-entry-plugin.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,95 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var logger = createLogger('[ Module Federation Rspack Plugin ]');
|
|
6
|
-
|
|
7
|
-
function _class_call_check(instance, Constructor) {
|
|
8
|
-
if (!(instance instanceof Constructor)) {
|
|
9
|
-
throw new TypeError("Cannot call a class as a function");
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
function _defineProperties(target, props) {
|
|
13
|
-
for(var i = 0; i < props.length; i++){
|
|
14
|
-
var descriptor = props[i];
|
|
15
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
16
|
-
descriptor.configurable = true;
|
|
17
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
18
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
22
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
23
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
24
|
-
return Constructor;
|
|
25
|
-
}
|
|
26
|
-
// @ts-ignore
|
|
27
|
-
var charMap = {
|
|
28
|
-
'<': '\\u003C',
|
|
29
|
-
'>': '\\u003E',
|
|
30
|
-
'/': '\\u002F',
|
|
31
|
-
'\\': '\\\\',
|
|
32
|
-
'\b': '\\b',
|
|
33
|
-
'\f': '\\f',
|
|
34
|
-
'\n': '\\n',
|
|
35
|
-
'\r': '\\r',
|
|
36
|
-
'\t': '\\t',
|
|
37
|
-
'\0': '\\0',
|
|
38
|
-
'\u2028': '\\u2028',
|
|
39
|
-
'\u2029': '\\u2029'
|
|
40
|
-
};
|
|
41
|
-
function escapeUnsafeChars(str) {
|
|
42
|
-
return str.replace(/[<>\b\f\n\r\t\0\u2028\u2029\\]/g, function(x) {
|
|
43
|
-
return charMap[x];
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
var RemoteEntryPlugin = /*#__PURE__*/ function() {
|
|
47
|
-
function RemoteEntryPlugin(options) {
|
|
48
|
-
_class_call_check(this, RemoteEntryPlugin);
|
|
49
|
-
this.name = 'VmokRemoteEntryPlugin';
|
|
50
|
-
this._options = options;
|
|
51
|
-
}
|
|
52
|
-
_create_class(RemoteEntryPlugin, [
|
|
53
|
-
{
|
|
54
|
-
key: "apply",
|
|
55
|
-
value: function apply(compiler) {
|
|
56
|
-
var _this__options = this._options, name = _this__options.name, getPublicPath = _this__options.getPublicPath;
|
|
57
|
-
if (!getPublicPath || !name) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
var containerManager = new ContainerManager();
|
|
61
|
-
containerManager.init(this._options);
|
|
62
|
-
if (!containerManager.enable) {
|
|
63
|
-
logger.warn("Detect you don't set exposes, 'getPublicPath' will not have effect.");
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
RemoteEntryPlugin.addPublicPathEntry(compiler, getPublicPath, name);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
], [
|
|
70
|
-
{
|
|
71
|
-
key: "addPublicPathEntry",
|
|
72
|
-
value: function addPublicPathEntry(compiler, getPublicPath, name) {
|
|
73
|
-
var code;
|
|
74
|
-
var sanitizedPublicPath = escapeUnsafeChars(getPublicPath);
|
|
75
|
-
if (!getPublicPath.startsWith('function')) {
|
|
76
|
-
code = "".concat(compiler.webpack.RuntimeGlobals.publicPath, " = new Function(").concat(JSON.stringify(sanitizedPublicPath), ")()");
|
|
77
|
-
} else {
|
|
78
|
-
code = "(".concat(sanitizedPublicPath, "())");
|
|
79
|
-
}
|
|
80
|
-
var base64Code = pBtoa(code);
|
|
81
|
-
var dataUrl = "data:text/javascript;base64,".concat(base64Code);
|
|
82
|
-
compiler.hooks.afterPlugins.tap('VmokRemoteEntryPlugin', function() {
|
|
83
|
-
new compiler.webpack.EntryPlugin(compiler.context, dataUrl, {
|
|
84
|
-
name: name
|
|
85
|
-
}).apply(compiler);
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
]);
|
|
90
|
-
return RemoteEntryPlugin;
|
|
91
|
-
}
|
|
92
|
-
();
|
|
93
|
-
|
|
94
|
-
export { RemoteEntryPlugin };
|
|
1
|
+
import 'btoa';
|
|
2
|
+
import '@module-federation/managers';
|
|
3
|
+
export { R as RemoteEntryPlugin } from './RemoteEntryPlugin.esm.mjs';
|
|
95
4
|
//# sourceMappingURL=remote-entry-plugin.esm.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-entry-plugin.esm.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote-entry-plugin.esm.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -11,6 +11,5 @@ export declare class ModuleFederationPlugin implements RspackPluginInstance {
|
|
|
11
11
|
private _checkSingleton;
|
|
12
12
|
apply(compiler: Compiler): void;
|
|
13
13
|
private _patchChunkSplit;
|
|
14
|
-
get statsResourceInfo(): Partial<import("@module-federation/manifest").ResourceInfo> | undefined;
|
|
15
14
|
}
|
|
16
15
|
export declare const GetPublicPathPlugin: typeof RemoteEntryPlugin;
|
package/dist/src/logger.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/rspack",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-perf-devtools-20260106124142",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Module Federation",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"types": "./dist/index.d.ts",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"btoa": "1.2.1",
|
|
28
|
-
"@module-federation/bridge-react-webpack-plugin": "0.0.0-
|
|
29
|
-
"@module-federation/
|
|
30
|
-
"@module-federation/
|
|
31
|
-
"@module-federation/manifest": "0.0.0-
|
|
32
|
-
"@module-federation/
|
|
33
|
-
"@module-federation/
|
|
34
|
-
"@module-federation/
|
|
28
|
+
"@module-federation/bridge-react-webpack-plugin": "0.0.0-perf-devtools-20260106124142",
|
|
29
|
+
"@module-federation/managers": "0.0.0-perf-devtools-20260106124142",
|
|
30
|
+
"@module-federation/runtime-tools": "0.0.0-perf-devtools-20260106124142",
|
|
31
|
+
"@module-federation/manifest": "0.0.0-perf-devtools-20260106124142",
|
|
32
|
+
"@module-federation/sdk": "0.0.0-perf-devtools-20260106124142",
|
|
33
|
+
"@module-federation/dts-plugin": "0.0.0-perf-devtools-20260106124142",
|
|
34
|
+
"@module-federation/inject-external-runtime-core-plugin": "0.0.0-perf-devtools-20260106124142"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@rspack/core": "^1.0.2"
|