@module-federation/sdk 0.11.1 → 0.11.2
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/index.cjs.js
CHANGED
|
@@ -56,7 +56,11 @@ var SharePlugin = /*#__PURE__*/Object.freeze({
|
|
|
56
56
|
});
|
|
57
57
|
|
|
58
58
|
function isBrowserEnv() {
|
|
59
|
-
return typeof window !== 'undefined';
|
|
59
|
+
return typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
60
|
+
}
|
|
61
|
+
function isReactNativeEnv() {
|
|
62
|
+
var _navigator;
|
|
63
|
+
return typeof navigator !== 'undefined' && ((_navigator = navigator) == null ? void 0 : _navigator.product) === 'ReactNative';
|
|
60
64
|
}
|
|
61
65
|
function isBrowserDebug() {
|
|
62
66
|
try {
|
|
@@ -369,6 +373,9 @@ function isManifestProvider(moduleInfo) {
|
|
|
369
373
|
|
|
370
374
|
const PREFIX = '[ Module Federation ]';
|
|
371
375
|
let Logger = class Logger {
|
|
376
|
+
setPrefix(prefix) {
|
|
377
|
+
this.prefix = prefix;
|
|
378
|
+
}
|
|
372
379
|
log(...args) {
|
|
373
380
|
console.log(this.prefix, ...args);
|
|
374
381
|
}
|
|
@@ -787,6 +794,7 @@ exports.inferAutoPublicPath = inferAutoPublicPath;
|
|
|
787
794
|
exports.isBrowserEnv = isBrowserEnv;
|
|
788
795
|
exports.isDebugMode = isDebugMode;
|
|
789
796
|
exports.isManifestProvider = isManifestProvider;
|
|
797
|
+
exports.isReactNativeEnv = isReactNativeEnv;
|
|
790
798
|
exports.isRequiredVersion = isRequiredVersion;
|
|
791
799
|
exports.isStaticResourcesEqual = isStaticResourcesEqual;
|
|
792
800
|
exports.loadScript = loadScript;
|
package/dist/index.esm.mjs
CHANGED
|
@@ -54,7 +54,11 @@ var SharePlugin = /*#__PURE__*/Object.freeze({
|
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
function isBrowserEnv() {
|
|
57
|
-
return typeof window !== 'undefined';
|
|
57
|
+
return typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
58
|
+
}
|
|
59
|
+
function isReactNativeEnv() {
|
|
60
|
+
var _navigator;
|
|
61
|
+
return typeof navigator !== 'undefined' && ((_navigator = navigator) == null ? void 0 : _navigator.product) === 'ReactNative';
|
|
58
62
|
}
|
|
59
63
|
function isBrowserDebug() {
|
|
60
64
|
try {
|
|
@@ -367,6 +371,9 @@ function isManifestProvider(moduleInfo) {
|
|
|
367
371
|
|
|
368
372
|
const PREFIX = '[ Module Federation ]';
|
|
369
373
|
let Logger = class Logger {
|
|
374
|
+
setPrefix(prefix) {
|
|
375
|
+
this.prefix = prefix;
|
|
376
|
+
}
|
|
370
377
|
log(...args) {
|
|
371
378
|
console.log(this.prefix, ...args);
|
|
372
379
|
}
|
|
@@ -750,4 +757,4 @@ function normalizeOptions(enableDefault, defaultOptions, key) {
|
|
|
750
757
|
};
|
|
751
758
|
}
|
|
752
759
|
|
|
753
|
-
export { BROWSER_LOG_KEY, BROWSER_LOG_VALUE, ENCODE_NAME_PREFIX, EncodedNameTransformMap, FederationModuleManifest, MANIFEST_EXT, MFModuleType, MFPrefetchCommon, MODULE_DEVTOOL_IDENTIFIER, ManifestFileName, NameTransformMap, NameTransformSymbol, SEPARATOR, StatsFileName, TEMP_DIR, assert, composeKeyWithSeparator, ContainerPlugin as containerPlugin, ContainerReferencePlugin as containerReferencePlugin, createLink, createLogger, createScript, createScriptNode, decodeName, encodeName, error, generateExposeFilename, generateShareFilename, generateSnapshotFromManifest, getProcessEnv, getResourceUrl, inferAutoPublicPath, isBrowserEnv, isDebugMode, isManifestProvider, isRequiredVersion, isStaticResourcesEqual, loadScript, loadScriptNode, logger, ModuleFederationPlugin as moduleFederationPlugin, normalizeOptions, parseEntry, safeToString, safeWrapper, SharePlugin as sharePlugin, simpleJoinRemoteEntry, warn };
|
|
760
|
+
export { BROWSER_LOG_KEY, BROWSER_LOG_VALUE, ENCODE_NAME_PREFIX, EncodedNameTransformMap, FederationModuleManifest, MANIFEST_EXT, MFModuleType, MFPrefetchCommon, MODULE_DEVTOOL_IDENTIFIER, ManifestFileName, NameTransformMap, NameTransformSymbol, SEPARATOR, StatsFileName, TEMP_DIR, assert, composeKeyWithSeparator, ContainerPlugin as containerPlugin, ContainerReferencePlugin as containerReferencePlugin, createLink, createLogger, createScript, createScriptNode, decodeName, encodeName, error, generateExposeFilename, generateShareFilename, generateSnapshotFromManifest, getProcessEnv, getResourceUrl, inferAutoPublicPath, isBrowserEnv, isDebugMode, isManifestProvider, isReactNativeEnv, isRequiredVersion, isStaticResourcesEqual, loadScript, loadScriptNode, logger, ModuleFederationPlugin as moduleFederationPlugin, normalizeOptions, parseEntry, safeToString, safeWrapper, SharePlugin as sharePlugin, simpleJoinRemoteEntry, warn };
|
package/dist/src/env.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ declare global {
|
|
|
2
2
|
var FEDERATION_DEBUG: string | undefined;
|
|
3
3
|
}
|
|
4
4
|
declare function isBrowserEnv(): boolean;
|
|
5
|
+
declare function isReactNativeEnv(): boolean;
|
|
5
6
|
declare function isDebugMode(): boolean;
|
|
6
7
|
declare const getProcessEnv: () => Record<string, string | undefined>;
|
|
7
|
-
export { isBrowserEnv, isDebugMode, getProcessEnv };
|
|
8
|
+
export { isBrowserEnv, isReactNativeEnv, isDebugMode, getProcessEnv };
|
package/dist/src/logger.d.ts
CHANGED