@module-federation/sdk 0.3.0 → 0.3.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/README.md +99 -0
- package/dist/LICENSE +21 -0
- package/dist/index.cjs.js +749 -0
- package/dist/index.esm.js +701 -0
- package/dist/normalize-webpack-path.cjs.js +48 -0
- package/dist/normalize-webpack-path.esm.js +39 -0
- package/dist/package.json +44 -0
- package/{src → dist/src}/constant.d.ts +9 -0
- package/dist/src/dom.d.ts +30 -0
- package/{src → dist/src}/generateSnapshotFromManifest.d.ts +1 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/node.d.ts +5 -0
- package/{src → dist/src}/normalize-webpack-path.d.ts +3 -1
- package/dist/src/normalizeOptions.d.ts +1 -0
- package/{src → dist/src}/types/index.d.ts +1 -0
- package/dist/src/types/plugins/ContainerPlugin.d.ts +159 -0
- package/dist/src/types/plugins/ContainerReferencePlugin.d.ts +52 -0
- package/dist/src/types/plugins/ModuleFederationPlugin.d.ts +334 -0
- package/dist/src/types/plugins/SharePlugin.d.ts +71 -0
- package/dist/src/types/plugins/index.d.ts +4 -0
- package/{src → dist/src}/types/snapshot.d.ts +7 -0
- package/{src → dist/src}/types/stats.d.ts +15 -5
- package/{src → dist/src}/utils.d.ts +1 -1
- package/package.json +14 -11
- package/index.cjs.default.js +0 -1
- package/index.cjs.js +0 -793
- package/index.cjs.mjs +0 -2
- package/index.esm.js +0 -761
- package/normalize-webpack-path.cjs.default.js +0 -1
- package/normalize-webpack-path.cjs.js +0 -42
- package/normalize-webpack-path.cjs.mjs +0 -2
- package/normalize-webpack-path.esm.js +0 -33
- package/src/dom.d.ts +0 -10
- package/src/index.d.ts +0 -7
- /package/{index.cjs.d.ts → dist/index.cjs.d.ts} +0 -0
- /package/{normalize-webpack-path.cjs.d.ts → dist/normalize-webpack-path.cjs.d.ts} +0 -0
- /package/{src → dist/src}/env.d.ts +0 -0
- /package/{src → dist/src}/logger.d.ts +0 -0
- /package/{src → dist/src}/types/common.d.ts +0 -0
- /package/{src → dist/src}/types/manifest.d.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exports._default = require('./normalize-webpack-path.cjs.js').default;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var path = require('path');
|
|
6
|
-
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
|
|
10
|
-
|
|
11
|
-
function getWebpackPath(compiler) {
|
|
12
|
-
try {
|
|
13
|
-
// @ts-ignore just throw err
|
|
14
|
-
compiler.webpack();
|
|
15
|
-
return "";
|
|
16
|
-
} catch (err) {
|
|
17
|
-
var _err_stack;
|
|
18
|
-
var trace = ((_err_stack = err.stack) === null || _err_stack === void 0 ? void 0 : _err_stack.split("\n")) || [];
|
|
19
|
-
var webpackErrLocation = trace.find(function(item) {
|
|
20
|
-
return item.includes("at webpack");
|
|
21
|
-
}) || "";
|
|
22
|
-
var webpackLocationWithDetail = webpackErrLocation.replace(/[^\(\)]+/, "").slice(1, -1);
|
|
23
|
-
var webpackPath = webpackLocationWithDetail.split(":").slice(0, -2)[0];
|
|
24
|
-
return require.resolve("webpack", {
|
|
25
|
-
paths: [
|
|
26
|
-
webpackPath
|
|
27
|
-
]
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
var normalizeWebpackPath = function(fullPath) {
|
|
32
|
-
if (fullPath === "webpack") {
|
|
33
|
-
return process.env["FEDERATION_WEBPACK_PATH"] || fullPath;
|
|
34
|
-
}
|
|
35
|
-
if (process.env["FEDERATION_WEBPACK_PATH"]) {
|
|
36
|
-
return path__default["default"].resolve(process.env["FEDERATION_WEBPACK_PATH"], fullPath.replace("webpack", "../../"));
|
|
37
|
-
}
|
|
38
|
-
return fullPath;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
exports.getWebpackPath = getWebpackPath;
|
|
42
|
-
exports.normalizeWebpackPath = normalizeWebpackPath;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
|
|
3
|
-
function getWebpackPath(compiler) {
|
|
4
|
-
try {
|
|
5
|
-
// @ts-ignore just throw err
|
|
6
|
-
compiler.webpack();
|
|
7
|
-
return "";
|
|
8
|
-
} catch (err) {
|
|
9
|
-
var _err_stack;
|
|
10
|
-
var trace = ((_err_stack = err.stack) === null || _err_stack === void 0 ? void 0 : _err_stack.split("\n")) || [];
|
|
11
|
-
var webpackErrLocation = trace.find(function(item) {
|
|
12
|
-
return item.includes("at webpack");
|
|
13
|
-
}) || "";
|
|
14
|
-
var webpackLocationWithDetail = webpackErrLocation.replace(/[^\(\)]+/, "").slice(1, -1);
|
|
15
|
-
var webpackPath = webpackLocationWithDetail.split(":").slice(0, -2)[0];
|
|
16
|
-
return require.resolve("webpack", {
|
|
17
|
-
paths: [
|
|
18
|
-
webpackPath
|
|
19
|
-
]
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
var normalizeWebpackPath = function(fullPath) {
|
|
24
|
-
if (fullPath === "webpack") {
|
|
25
|
-
return process.env["FEDERATION_WEBPACK_PATH"] || fullPath;
|
|
26
|
-
}
|
|
27
|
-
if (process.env["FEDERATION_WEBPACK_PATH"]) {
|
|
28
|
-
return path.resolve(process.env["FEDERATION_WEBPACK_PATH"], fullPath.replace("webpack", "../../"));
|
|
29
|
-
}
|
|
30
|
-
return fullPath;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export { getWebpackPath, normalizeWebpackPath };
|
package/src/dom.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare function safeWrapper<T extends (...args: Array<any>) => any>(callback: T, disableWarn?: boolean): Promise<ReturnType<T> | undefined>;
|
|
2
|
-
export declare function isStaticResourcesEqual(url1: string, url2: string): boolean;
|
|
3
|
-
export declare function createScript(url: string, cb: (value: void | PromiseLike<void>) => void, attrs?: Record<string, any>, createScriptHook?: (url: string) => HTMLScriptElement | void): {
|
|
4
|
-
script: HTMLScriptElement;
|
|
5
|
-
needAttach: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare function loadScript(url: string, info: {
|
|
8
|
-
attrs?: Record<string, any>;
|
|
9
|
-
createScriptHook?: (url: string) => HTMLScriptElement | void;
|
|
10
|
-
}): Promise<void>;
|
package/src/index.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|