@module-federation/rspack 0.19.0 → 0.20.0

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.
@@ -1,95 +1,4 @@
1
- import pBtoa from 'btoa';
2
- import { ContainerManager } from '@module-federation/managers';
3
- import { createLogger } from '@module-federation/sdk';
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":";;"}
@@ -1,2 +1,3 @@
1
- declare const logger: import("@module-federation/sdk").Logger;
1
+ import { type Logger } from '@module-federation/sdk';
2
+ declare const logger: Logger;
2
3
  export default logger;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/rspack",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
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.19.0",
29
- "@module-federation/runtime-tools": "0.19.0",
30
- "@module-federation/dts-plugin": "0.19.0",
31
- "@module-federation/manifest": "0.19.0",
32
- "@module-federation/sdk": "0.19.0",
33
- "@module-federation/managers": "0.19.0",
34
- "@module-federation/inject-external-runtime-core-plugin": "0.19.0"
28
+ "@module-federation/bridge-react-webpack-plugin": "0.20.0",
29
+ "@module-federation/dts-plugin": "0.20.0",
30
+ "@module-federation/managers": "0.20.0",
31
+ "@module-federation/manifest": "0.20.0",
32
+ "@module-federation/inject-external-runtime-core-plugin": "0.20.0",
33
+ "@module-federation/runtime-tools": "0.20.0",
34
+ "@module-federation/sdk": "0.20.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@rspack/core": "^1.0.2"