@module-federation/rspack 2.0.0 → 2.0.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/ModuleFederationPlugin.js +362 -0
- package/dist/ModuleFederationPlugin.mjs +299 -0
- package/dist/RemoteEntryPlugin.js +131 -0
- package/dist/{RemoteEntryPlugin.esm.mjs → RemoteEntryPlugin.mjs} +23 -21
- package/dist/TreeShakingSharedPlugin.js +63 -0
- package/dist/TreeShakingSharedPlugin.mjs +15 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +69 -0
- package/dist/index.mjs +14 -0
- package/dist/logger.js +62 -0
- package/dist/logger.mjs +12 -0
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +95 -0
- package/dist/plugin.mjs +5 -0
- package/dist/remote-entry-plugin.d.ts +1 -1
- package/dist/remote-entry-plugin.js +95 -0
- package/dist/remote-entry-plugin.mjs +5 -0
- package/package.json +34 -19
- package/dist/RemoteEntryPlugin.cjs.js +0 -70
- package/dist/RemoteEntryPlugin.cjs.js.map +0 -1
- package/dist/RemoteEntryPlugin.esm.mjs.map +0 -1
- package/dist/index.cjs.js +0 -13
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.esm.d.ts +0 -1
- package/dist/index.esm.mjs +0 -8
- package/dist/index.esm.mjs.map +0 -1
- package/dist/plugin.cjs.js +0 -284
- package/dist/plugin.cjs.js.map +0 -1
- package/dist/plugin.esm.d.ts +0 -1
- package/dist/plugin.esm.mjs +0 -279
- package/dist/plugin.esm.mjs.map +0 -1
- package/dist/remote-entry-plugin.cjs.js +0 -10
- package/dist/remote-entry-plugin.cjs.js.map +0 -1
- package/dist/remote-entry-plugin.esm.d.ts +0 -1
- package/dist/remote-entry-plugin.esm.mjs +0 -4
- package/dist/remote-entry-plugin.esm.mjs.map +0 -1
- package/dist/src/index.d.ts +0 -3
- /package/dist/{src/ModuleFederationPlugin.d.ts → ModuleFederationPlugin.d.ts} +0 -0
- /package/dist/{src/RemoteEntryPlugin.d.ts → RemoteEntryPlugin.d.ts} +0 -0
- /package/dist/{src/TreeShakingSharedPlugin.d.ts → TreeShakingSharedPlugin.d.ts} +0 -0
- /package/dist/{src/logger.d.ts → logger.d.ts} +0 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
// The require scope
|
|
10
|
+
var __webpack_require__ = {};
|
|
11
|
+
|
|
12
|
+
/************************************************************************/
|
|
13
|
+
// webpack/runtime/compat_get_default_export
|
|
14
|
+
(() => {
|
|
15
|
+
// getDefaultExport function for compatibility with non-ESM modules
|
|
16
|
+
__webpack_require__.n = (module) => {
|
|
17
|
+
var getter = module && module.__esModule ?
|
|
18
|
+
() => (module['default']) :
|
|
19
|
+
() => (module);
|
|
20
|
+
__webpack_require__.d(getter, { a: getter });
|
|
21
|
+
return getter;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
})();
|
|
25
|
+
// webpack/runtime/define_property_getters
|
|
26
|
+
(() => {
|
|
27
|
+
__webpack_require__.d = (exports, definition) => {
|
|
28
|
+
for(var key in definition) {
|
|
29
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
30
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
// webpack/runtime/has_own_property
|
|
36
|
+
(() => {
|
|
37
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
38
|
+
})();
|
|
39
|
+
// webpack/runtime/make_namespace_object
|
|
40
|
+
(() => {
|
|
41
|
+
// define __esModule on exports
|
|
42
|
+
__webpack_require__.r = (exports) => {
|
|
43
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
44
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
45
|
+
}
|
|
46
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
47
|
+
};
|
|
48
|
+
})();
|
|
49
|
+
/************************************************************************/
|
|
50
|
+
var __webpack_exports__ = {};
|
|
51
|
+
// ESM COMPAT FLAG
|
|
52
|
+
__webpack_require__.r(__webpack_exports__);
|
|
53
|
+
|
|
54
|
+
// EXPORTS
|
|
55
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
56
|
+
RemoteEntryPlugin: () => (/* binding */ RemoteEntryPlugin)
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
;// CONCATENATED MODULE: external "btoa"
|
|
60
|
+
const external_btoa_namespaceObject = require("btoa");
|
|
61
|
+
var external_btoa_default = /*#__PURE__*/__webpack_require__.n(external_btoa_namespaceObject);
|
|
62
|
+
;// CONCATENATED MODULE: external "@module-federation/managers"
|
|
63
|
+
const managers_namespaceObject = require("@module-federation/managers");
|
|
64
|
+
;// CONCATENATED MODULE: external "./logger.js"
|
|
65
|
+
const external_logger_js_namespaceObject = require("./logger.js");
|
|
66
|
+
var external_logger_js_default = /*#__PURE__*/__webpack_require__.n(external_logger_js_namespaceObject);
|
|
67
|
+
;// CONCATENATED MODULE: ./src/RemoteEntryPlugin.ts
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
// @ts-ignore
|
|
72
|
+
const charMap = {
|
|
73
|
+
'<': '\\u003C',
|
|
74
|
+
'>': '\\u003E',
|
|
75
|
+
'/': '\\u002F',
|
|
76
|
+
'\\': '\\\\',
|
|
77
|
+
'\b': '\\b',
|
|
78
|
+
'\f': '\\f',
|
|
79
|
+
'\n': '\\n',
|
|
80
|
+
'\r': '\\r',
|
|
81
|
+
'\t': '\\t',
|
|
82
|
+
'\0': '\\0',
|
|
83
|
+
'\u2028': '\\u2028',
|
|
84
|
+
'\u2029': '\\u2029'
|
|
85
|
+
};
|
|
86
|
+
function escapeUnsafeChars(str) {
|
|
87
|
+
return str.replace(/[<>\b\f\n\r\t\0\u2028\u2029\\]/g, (x)=>charMap[x]);
|
|
88
|
+
}
|
|
89
|
+
class RemoteEntryPlugin {
|
|
90
|
+
static addPublicPathEntry(compiler, getPublicPath, name) {
|
|
91
|
+
let code;
|
|
92
|
+
const sanitizedPublicPath = escapeUnsafeChars(getPublicPath);
|
|
93
|
+
if (!getPublicPath.startsWith('function')) {
|
|
94
|
+
code = `${compiler.webpack.RuntimeGlobals.publicPath} = new Function(${JSON.stringify(sanitizedPublicPath)})()`;
|
|
95
|
+
} else {
|
|
96
|
+
code = `(${sanitizedPublicPath}())`;
|
|
97
|
+
}
|
|
98
|
+
const base64Code = external_btoa_default()(code);
|
|
99
|
+
const dataUrl = `data:text/javascript;base64,${base64Code}`;
|
|
100
|
+
compiler.hooks.afterPlugins.tap('VmokRemoteEntryPlugin', ()=>{
|
|
101
|
+
new compiler.webpack.EntryPlugin(compiler.context, dataUrl, {
|
|
102
|
+
name: name
|
|
103
|
+
}).apply(compiler);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
apply(compiler) {
|
|
107
|
+
const { name, getPublicPath } = this._options;
|
|
108
|
+
if (!getPublicPath || !name) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const containerManager = new managers_namespaceObject.ContainerManager();
|
|
112
|
+
containerManager.init(this._options);
|
|
113
|
+
if (!containerManager.enable) {
|
|
114
|
+
external_logger_js_default().warn("Detect you don't set exposes, 'getPublicPath' will not have effect.");
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
RemoteEntryPlugin.addPublicPathEntry(compiler, getPublicPath, name);
|
|
118
|
+
}
|
|
119
|
+
constructor(options){
|
|
120
|
+
this.name = 'VmokRemoteEntryPlugin';
|
|
121
|
+
this._options = options;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
exports.RemoteEntryPlugin = __webpack_exports__.RemoteEntryPlugin;
|
|
126
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
127
|
+
if(["RemoteEntryPlugin"].indexOf(__webpack_i__) === -1) {
|
|
128
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ContainerManager } from
|
|
3
|
-
import
|
|
1
|
+
import btoa from "btoa";
|
|
2
|
+
import { ContainerManager } from "@module-federation/managers";
|
|
3
|
+
import logger from "./logger.mjs";
|
|
4
|
+
|
|
5
|
+
;// CONCATENATED MODULE: external "btoa"
|
|
6
|
+
|
|
7
|
+
;// CONCATENATED MODULE: external "@module-federation/managers"
|
|
8
|
+
|
|
9
|
+
;// CONCATENATED MODULE: external "./logger.mjs"
|
|
10
|
+
|
|
11
|
+
;// CONCATENATED MODULE: ./src/RemoteEntryPlugin.ts
|
|
12
|
+
|
|
4
13
|
|
|
5
|
-
const isLoggerFactory = (candidate) => typeof candidate === 'function';
|
|
6
|
-
const createBundlerLogger = isLoggerFactory(createInfrastructureLogger)
|
|
7
|
-
? (prefix) => createInfrastructureLogger(prefix)
|
|
8
|
-
: createLogger;
|
|
9
|
-
const logger = createBundlerLogger('[ Module Federation Rspack Plugin ]');
|
|
10
14
|
|
|
11
15
|
// @ts-ignore
|
|
12
16
|
const charMap = {
|
|
@@ -21,30 +25,25 @@ const charMap = {
|
|
|
21
25
|
'\t': '\\t',
|
|
22
26
|
'\0': '\\0',
|
|
23
27
|
'\u2028': '\\u2028',
|
|
24
|
-
'\u2029': '\\u2029'
|
|
28
|
+
'\u2029': '\\u2029'
|
|
25
29
|
};
|
|
26
30
|
function escapeUnsafeChars(str) {
|
|
27
|
-
return str.replace(/[<>\b\f\n\r\t\0\u2028\u2029\\]/g, (x)
|
|
31
|
+
return str.replace(/[<>\b\f\n\r\t\0\u2028\u2029\\]/g, (x)=>charMap[x]);
|
|
28
32
|
}
|
|
29
33
|
class RemoteEntryPlugin {
|
|
30
|
-
constructor(options) {
|
|
31
|
-
this.name = 'VmokRemoteEntryPlugin';
|
|
32
|
-
this._options = options;
|
|
33
|
-
}
|
|
34
34
|
static addPublicPathEntry(compiler, getPublicPath, name) {
|
|
35
35
|
let code;
|
|
36
36
|
const sanitizedPublicPath = escapeUnsafeChars(getPublicPath);
|
|
37
37
|
if (!getPublicPath.startsWith('function')) {
|
|
38
38
|
code = `${compiler.webpack.RuntimeGlobals.publicPath} = new Function(${JSON.stringify(sanitizedPublicPath)})()`;
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
39
|
+
} else {
|
|
41
40
|
code = `(${sanitizedPublicPath}())`;
|
|
42
41
|
}
|
|
43
|
-
const base64Code =
|
|
42
|
+
const base64Code = btoa(code);
|
|
44
43
|
const dataUrl = `data:text/javascript;base64,${base64Code}`;
|
|
45
|
-
compiler.hooks.afterPlugins.tap('VmokRemoteEntryPlugin', ()
|
|
44
|
+
compiler.hooks.afterPlugins.tap('VmokRemoteEntryPlugin', ()=>{
|
|
46
45
|
new compiler.webpack.EntryPlugin(compiler.context, dataUrl, {
|
|
47
|
-
name: name
|
|
46
|
+
name: name
|
|
48
47
|
}).apply(compiler);
|
|
49
48
|
});
|
|
50
49
|
}
|
|
@@ -61,7 +60,10 @@ class RemoteEntryPlugin {
|
|
|
61
60
|
}
|
|
62
61
|
RemoteEntryPlugin.addPublicPathEntry(compiler, getPublicPath, name);
|
|
63
62
|
}
|
|
63
|
+
constructor(options){
|
|
64
|
+
this.name = 'VmokRemoteEntryPlugin';
|
|
65
|
+
this._options = options;
|
|
66
|
+
}
|
|
64
67
|
}
|
|
65
68
|
|
|
66
|
-
export { RemoteEntryPlugin
|
|
67
|
-
//# sourceMappingURL=RemoteEntryPlugin.esm.mjs.map
|
|
69
|
+
export { RemoteEntryPlugin };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
// The require scope
|
|
10
|
+
var __webpack_require__ = {};
|
|
11
|
+
|
|
12
|
+
/************************************************************************/
|
|
13
|
+
// webpack/runtime/define_property_getters
|
|
14
|
+
(() => {
|
|
15
|
+
__webpack_require__.d = (exports, definition) => {
|
|
16
|
+
for(var key in definition) {
|
|
17
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
18
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
})();
|
|
23
|
+
// webpack/runtime/has_own_property
|
|
24
|
+
(() => {
|
|
25
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
26
|
+
})();
|
|
27
|
+
// webpack/runtime/make_namespace_object
|
|
28
|
+
(() => {
|
|
29
|
+
// define __esModule on exports
|
|
30
|
+
__webpack_require__.r = (exports) => {
|
|
31
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
32
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
/************************************************************************/
|
|
38
|
+
var __webpack_exports__ = {};
|
|
39
|
+
__webpack_require__.r(__webpack_exports__);
|
|
40
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
41
|
+
PLUGIN_NAME: () => (PLUGIN_NAME),
|
|
42
|
+
TreeShakingSharedPlugin: () => (TreeShakingSharedPlugin)
|
|
43
|
+
});
|
|
44
|
+
const PLUGIN_NAME = 'RspackTreeShakingSharedPlugin';
|
|
45
|
+
class TreeShakingSharedPlugin {
|
|
46
|
+
apply(compiler) {
|
|
47
|
+
// @ts-expect-error wait rspack release
|
|
48
|
+
new compiler.rspack.sharing.TreeShakingSharedPlugin(this._options).apply(compiler);
|
|
49
|
+
}
|
|
50
|
+
constructor(options){
|
|
51
|
+
this.name = PLUGIN_NAME;
|
|
52
|
+
this._options = options;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
exports.PLUGIN_NAME = __webpack_exports__.PLUGIN_NAME;
|
|
57
|
+
exports.TreeShakingSharedPlugin = __webpack_exports__.TreeShakingSharedPlugin;
|
|
58
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
59
|
+
if(["PLUGIN_NAME","TreeShakingSharedPlugin"].indexOf(__webpack_i__) === -1) {
|
|
60
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
;// CONCATENATED MODULE: ./src/TreeShakingSharedPlugin.ts
|
|
3
|
+
const PLUGIN_NAME = 'RspackTreeShakingSharedPlugin';
|
|
4
|
+
class TreeShakingSharedPlugin {
|
|
5
|
+
apply(compiler) {
|
|
6
|
+
// @ts-expect-error wait rspack release
|
|
7
|
+
new compiler.rspack.sharing.TreeShakingSharedPlugin(this._options).apply(compiler);
|
|
8
|
+
}
|
|
9
|
+
constructor(options){
|
|
10
|
+
this.name = PLUGIN_NAME;
|
|
11
|
+
this._options = options;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { PLUGIN_NAME, TreeShakingSharedPlugin };
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { ModuleFederationPlugin, PLUGIN_NAME } from './ModuleFederationPlugin';
|
|
2
|
+
export declare const ContainerPlugin: typeof import("@rspack/core/dist/container/ContainerPlugin").ContainerPlugin;
|
|
3
|
+
export declare const ContainerReferencePlugin: typeof import("@rspack/core/dist/container/ContainerReferencePlugin").ContainerReferencePlugin;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
// The require scope
|
|
10
|
+
var __webpack_require__ = {};
|
|
11
|
+
|
|
12
|
+
/************************************************************************/
|
|
13
|
+
// webpack/runtime/define_property_getters
|
|
14
|
+
(() => {
|
|
15
|
+
__webpack_require__.d = (exports, definition) => {
|
|
16
|
+
for(var key in definition) {
|
|
17
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
18
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
})();
|
|
23
|
+
// webpack/runtime/has_own_property
|
|
24
|
+
(() => {
|
|
25
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
26
|
+
})();
|
|
27
|
+
// webpack/runtime/make_namespace_object
|
|
28
|
+
(() => {
|
|
29
|
+
// define __esModule on exports
|
|
30
|
+
__webpack_require__.r = (exports) => {
|
|
31
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
32
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
/************************************************************************/
|
|
38
|
+
var __webpack_exports__ = {};
|
|
39
|
+
// ESM COMPAT FLAG
|
|
40
|
+
__webpack_require__.r(__webpack_exports__);
|
|
41
|
+
|
|
42
|
+
// EXPORTS
|
|
43
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
44
|
+
ModuleFederationPlugin: () => (/* reexport */ external_ModuleFederationPlugin_js_namespaceObject.ModuleFederationPlugin),
|
|
45
|
+
PLUGIN_NAME: () => (/* reexport */ external_ModuleFederationPlugin_js_namespaceObject.PLUGIN_NAME),
|
|
46
|
+
ContainerPlugin: () => (/* binding */ ContainerPlugin),
|
|
47
|
+
ContainerReferencePlugin: () => (/* binding */ ContainerReferencePlugin)
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
;// CONCATENATED MODULE: external "./ModuleFederationPlugin.js"
|
|
51
|
+
const external_ModuleFederationPlugin_js_namespaceObject = require("./ModuleFederationPlugin.js");
|
|
52
|
+
;// CONCATENATED MODULE: external "@rspack/core"
|
|
53
|
+
const core_namespaceObject = require("@rspack/core");
|
|
54
|
+
;// CONCATENATED MODULE: ./src/index.ts
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
const ContainerPlugin = core_namespaceObject.container.ContainerPlugin;
|
|
58
|
+
const ContainerReferencePlugin = core_namespaceObject.container.ContainerReferencePlugin;
|
|
59
|
+
|
|
60
|
+
exports.ContainerPlugin = __webpack_exports__.ContainerPlugin;
|
|
61
|
+
exports.ContainerReferencePlugin = __webpack_exports__.ContainerReferencePlugin;
|
|
62
|
+
exports.ModuleFederationPlugin = __webpack_exports__.ModuleFederationPlugin;
|
|
63
|
+
exports.PLUGIN_NAME = __webpack_exports__.PLUGIN_NAME;
|
|
64
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
65
|
+
if(["ContainerPlugin","ContainerReferencePlugin","ModuleFederationPlugin","PLUGIN_NAME"].indexOf(__webpack_i__) === -1) {
|
|
66
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ModuleFederationPlugin, PLUGIN_NAME } from "./ModuleFederationPlugin.mjs";
|
|
2
|
+
import { container } from "@rspack/core";
|
|
3
|
+
|
|
4
|
+
;// CONCATENATED MODULE: external "./ModuleFederationPlugin.mjs"
|
|
5
|
+
|
|
6
|
+
;// CONCATENATED MODULE: external "@rspack/core"
|
|
7
|
+
|
|
8
|
+
;// CONCATENATED MODULE: ./src/index.ts
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const ContainerPlugin = container.ContainerPlugin;
|
|
12
|
+
const ContainerReferencePlugin = container.ContainerReferencePlugin;
|
|
13
|
+
|
|
14
|
+
export { ContainerPlugin, ContainerReferencePlugin, ModuleFederationPlugin, PLUGIN_NAME };
|
package/dist/logger.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
// The require scope
|
|
10
|
+
var __webpack_require__ = {};
|
|
11
|
+
|
|
12
|
+
/************************************************************************/
|
|
13
|
+
// webpack/runtime/define_property_getters
|
|
14
|
+
(() => {
|
|
15
|
+
__webpack_require__.d = (exports, definition) => {
|
|
16
|
+
for(var key in definition) {
|
|
17
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
18
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
})();
|
|
23
|
+
// webpack/runtime/has_own_property
|
|
24
|
+
(() => {
|
|
25
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
26
|
+
})();
|
|
27
|
+
// webpack/runtime/make_namespace_object
|
|
28
|
+
(() => {
|
|
29
|
+
// define __esModule on exports
|
|
30
|
+
__webpack_require__.r = (exports) => {
|
|
31
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
32
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
/************************************************************************/
|
|
38
|
+
var __webpack_exports__ = {};
|
|
39
|
+
// ESM COMPAT FLAG
|
|
40
|
+
__webpack_require__.r(__webpack_exports__);
|
|
41
|
+
|
|
42
|
+
// EXPORTS
|
|
43
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
44
|
+
"default": () => (/* binding */ src_logger)
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
;// CONCATENATED MODULE: external "@module-federation/sdk"
|
|
48
|
+
const sdk_namespaceObject = require("@module-federation/sdk");
|
|
49
|
+
;// CONCATENATED MODULE: ./src/logger.ts
|
|
50
|
+
|
|
51
|
+
const isLoggerFactory = (candidate)=>typeof candidate === 'function';
|
|
52
|
+
const createBundlerLogger = isLoggerFactory(sdk_namespaceObject.createInfrastructureLogger) ? (prefix)=>(0,sdk_namespaceObject.createInfrastructureLogger)(prefix) : sdk_namespaceObject.createLogger;
|
|
53
|
+
const logger = createBundlerLogger('[ Module Federation Rspack Plugin ]');
|
|
54
|
+
/* ESM default export */ const src_logger = (logger);
|
|
55
|
+
|
|
56
|
+
exports["default"] = __webpack_exports__["default"];
|
|
57
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
58
|
+
if(["default"].indexOf(__webpack_i__) === -1) {
|
|
59
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
package/dist/logger.mjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createInfrastructureLogger, createLogger } from "@module-federation/sdk";
|
|
2
|
+
|
|
3
|
+
;// CONCATENATED MODULE: external "@module-federation/sdk"
|
|
4
|
+
|
|
5
|
+
;// CONCATENATED MODULE: ./src/logger.ts
|
|
6
|
+
|
|
7
|
+
const isLoggerFactory = (candidate)=>typeof candidate === 'function';
|
|
8
|
+
const createBundlerLogger = isLoggerFactory(createInfrastructureLogger) ? (prefix)=>createInfrastructureLogger(prefix) : createLogger;
|
|
9
|
+
const logger = createBundlerLogger('[ Module Federation Rspack Plugin ]');
|
|
10
|
+
/* ESM default export */ const src_logger = (logger);
|
|
11
|
+
|
|
12
|
+
export { src_logger as default };
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './ModuleFederationPlugin';
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
var __webpack_modules__ = ({
|
|
10
|
+
"./ModuleFederationPlugin": (function (module) {
|
|
11
|
+
module.exports = require("./ModuleFederationPlugin.js");
|
|
12
|
+
|
|
13
|
+
}),
|
|
14
|
+
|
|
15
|
+
});
|
|
16
|
+
/************************************************************************/
|
|
17
|
+
// The module cache
|
|
18
|
+
var __webpack_module_cache__ = {};
|
|
19
|
+
|
|
20
|
+
// The require function
|
|
21
|
+
function __webpack_require__(moduleId) {
|
|
22
|
+
|
|
23
|
+
// Check if module is in cache
|
|
24
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
25
|
+
if (cachedModule !== undefined) {
|
|
26
|
+
return cachedModule.exports;
|
|
27
|
+
}
|
|
28
|
+
// Create a new module (and put it into the cache)
|
|
29
|
+
var module = (__webpack_module_cache__[moduleId] = {
|
|
30
|
+
exports: {}
|
|
31
|
+
});
|
|
32
|
+
// Execute the module function
|
|
33
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
34
|
+
|
|
35
|
+
// Return the exports of the module
|
|
36
|
+
return module.exports;
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/************************************************************************/
|
|
41
|
+
// webpack/runtime/compat_get_default_export
|
|
42
|
+
(() => {
|
|
43
|
+
// getDefaultExport function for compatibility with non-ESM modules
|
|
44
|
+
__webpack_require__.n = (module) => {
|
|
45
|
+
var getter = module && module.__esModule ?
|
|
46
|
+
() => (module['default']) :
|
|
47
|
+
() => (module);
|
|
48
|
+
__webpack_require__.d(getter, { a: getter });
|
|
49
|
+
return getter;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
})();
|
|
53
|
+
// webpack/runtime/define_property_getters
|
|
54
|
+
(() => {
|
|
55
|
+
__webpack_require__.d = (exports, definition) => {
|
|
56
|
+
for(var key in definition) {
|
|
57
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
58
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
})();
|
|
63
|
+
// webpack/runtime/has_own_property
|
|
64
|
+
(() => {
|
|
65
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
66
|
+
})();
|
|
67
|
+
// webpack/runtime/make_namespace_object
|
|
68
|
+
(() => {
|
|
69
|
+
// define __esModule on exports
|
|
70
|
+
__webpack_require__.r = (exports) => {
|
|
71
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
72
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
73
|
+
}
|
|
74
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
75
|
+
};
|
|
76
|
+
})();
|
|
77
|
+
/************************************************************************/
|
|
78
|
+
var __webpack_exports__ = {};
|
|
79
|
+
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
|
|
80
|
+
(() => {
|
|
81
|
+
__webpack_require__.r(__webpack_exports__);
|
|
82
|
+
/* ESM import */var _ModuleFederationPlugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./ModuleFederationPlugin");
|
|
83
|
+
/* ESM import */var _ModuleFederationPlugin__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ModuleFederationPlugin__WEBPACK_IMPORTED_MODULE_0__);
|
|
84
|
+
|
|
85
|
+
/* ESM reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
86
|
+
/* ESM reexport (unknown) */ for( var __WEBPACK_IMPORT_KEY__ in _ModuleFederationPlugin__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] =function(key) { return _ModuleFederationPlugin__WEBPACK_IMPORTED_MODULE_0__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
|
|
87
|
+
/* ESM reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
})();
|
|
91
|
+
|
|
92
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
93
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
94
|
+
}
|
|
95
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
package/dist/plugin.mjs
ADDED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './RemoteEntryPlugin';
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
var __webpack_modules__ = ({
|
|
10
|
+
"./RemoteEntryPlugin": (function (module) {
|
|
11
|
+
module.exports = require("./RemoteEntryPlugin.js");
|
|
12
|
+
|
|
13
|
+
}),
|
|
14
|
+
|
|
15
|
+
});
|
|
16
|
+
/************************************************************************/
|
|
17
|
+
// The module cache
|
|
18
|
+
var __webpack_module_cache__ = {};
|
|
19
|
+
|
|
20
|
+
// The require function
|
|
21
|
+
function __webpack_require__(moduleId) {
|
|
22
|
+
|
|
23
|
+
// Check if module is in cache
|
|
24
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
25
|
+
if (cachedModule !== undefined) {
|
|
26
|
+
return cachedModule.exports;
|
|
27
|
+
}
|
|
28
|
+
// Create a new module (and put it into the cache)
|
|
29
|
+
var module = (__webpack_module_cache__[moduleId] = {
|
|
30
|
+
exports: {}
|
|
31
|
+
});
|
|
32
|
+
// Execute the module function
|
|
33
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
34
|
+
|
|
35
|
+
// Return the exports of the module
|
|
36
|
+
return module.exports;
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/************************************************************************/
|
|
41
|
+
// webpack/runtime/compat_get_default_export
|
|
42
|
+
(() => {
|
|
43
|
+
// getDefaultExport function for compatibility with non-ESM modules
|
|
44
|
+
__webpack_require__.n = (module) => {
|
|
45
|
+
var getter = module && module.__esModule ?
|
|
46
|
+
() => (module['default']) :
|
|
47
|
+
() => (module);
|
|
48
|
+
__webpack_require__.d(getter, { a: getter });
|
|
49
|
+
return getter;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
})();
|
|
53
|
+
// webpack/runtime/define_property_getters
|
|
54
|
+
(() => {
|
|
55
|
+
__webpack_require__.d = (exports, definition) => {
|
|
56
|
+
for(var key in definition) {
|
|
57
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
58
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
})();
|
|
63
|
+
// webpack/runtime/has_own_property
|
|
64
|
+
(() => {
|
|
65
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
66
|
+
})();
|
|
67
|
+
// webpack/runtime/make_namespace_object
|
|
68
|
+
(() => {
|
|
69
|
+
// define __esModule on exports
|
|
70
|
+
__webpack_require__.r = (exports) => {
|
|
71
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
72
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
73
|
+
}
|
|
74
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
75
|
+
};
|
|
76
|
+
})();
|
|
77
|
+
/************************************************************************/
|
|
78
|
+
var __webpack_exports__ = {};
|
|
79
|
+
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
|
|
80
|
+
(() => {
|
|
81
|
+
__webpack_require__.r(__webpack_exports__);
|
|
82
|
+
/* ESM import */var _RemoteEntryPlugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./RemoteEntryPlugin");
|
|
83
|
+
/* ESM import */var _RemoteEntryPlugin__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_RemoteEntryPlugin__WEBPACK_IMPORTED_MODULE_0__);
|
|
84
|
+
|
|
85
|
+
/* ESM reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
86
|
+
/* ESM reexport (unknown) */ for( var __WEBPACK_IMPORT_KEY__ in _RemoteEntryPlugin__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] =function(key) { return _RemoteEntryPlugin__WEBPACK_IMPORTED_MODULE_0__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
|
|
87
|
+
/* ESM reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
})();
|
|
91
|
+
|
|
92
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
93
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
94
|
+
}
|
|
95
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|