@module-federation/sdk 0.13.0 → 0.14.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.
package/dist/index.cjs.cjs
CHANGED
|
@@ -635,7 +635,7 @@ const lazyLoaderHookFetch = async (input, init, loaderHook)=>{
|
|
|
635
635
|
}
|
|
636
636
|
return res;
|
|
637
637
|
};
|
|
638
|
-
|
|
638
|
+
const createScriptNode = typeof ENV_TARGET === 'undefined' || ENV_TARGET !== 'web' ? (url, cb, attrs, loaderHook)=>{
|
|
639
639
|
if (loaderHook == null ? void 0 : loaderHook.createScriptHook) {
|
|
640
640
|
const hookResult = loaderHook.createScriptHook(url);
|
|
641
641
|
if (hookResult && typeof hookResult === 'object' && 'url' in hookResult) {
|
|
@@ -707,8 +707,10 @@ function createScriptNode(url, cb, attrs, loaderHook) {
|
|
|
707
707
|
}).catch((err)=>{
|
|
708
708
|
cb(err);
|
|
709
709
|
});
|
|
710
|
-
}
|
|
711
|
-
|
|
710
|
+
} : (url, cb, attrs, loaderHook)=>{
|
|
711
|
+
cb(new Error('createScriptNode is disabled in non-Node.js environment'));
|
|
712
|
+
};
|
|
713
|
+
const loadScriptNode = typeof ENV_TARGET === 'undefined' || ENV_TARGET !== 'web' ? (url, info)=>{
|
|
712
714
|
return new Promise((resolve, reject)=>{
|
|
713
715
|
createScriptNode(url, (error, scriptContext)=>{
|
|
714
716
|
if (error) {
|
|
@@ -721,7 +723,9 @@ function loadScriptNode(url, info) {
|
|
|
721
723
|
}
|
|
722
724
|
}, info.attrs, info.loaderHook);
|
|
723
725
|
});
|
|
724
|
-
}
|
|
726
|
+
} : (url, info)=>{
|
|
727
|
+
throw new Error('loadScriptNode is disabled in non-Node.js environment');
|
|
728
|
+
};
|
|
725
729
|
async function loadModule(url, options) {
|
|
726
730
|
const { fetch: fetch1, vm } = options;
|
|
727
731
|
const response = await fetch1(url);
|
package/dist/index.esm.js
CHANGED
|
@@ -633,7 +633,7 @@ const lazyLoaderHookFetch = async (input, init, loaderHook)=>{
|
|
|
633
633
|
}
|
|
634
634
|
return res;
|
|
635
635
|
};
|
|
636
|
-
|
|
636
|
+
const createScriptNode = typeof ENV_TARGET === 'undefined' || ENV_TARGET !== 'web' ? (url, cb, attrs, loaderHook)=>{
|
|
637
637
|
if (loaderHook == null ? void 0 : loaderHook.createScriptHook) {
|
|
638
638
|
const hookResult = loaderHook.createScriptHook(url);
|
|
639
639
|
if (hookResult && typeof hookResult === 'object' && 'url' in hookResult) {
|
|
@@ -705,8 +705,10 @@ function createScriptNode(url, cb, attrs, loaderHook) {
|
|
|
705
705
|
}).catch((err)=>{
|
|
706
706
|
cb(err);
|
|
707
707
|
});
|
|
708
|
-
}
|
|
709
|
-
|
|
708
|
+
} : (url, cb, attrs, loaderHook)=>{
|
|
709
|
+
cb(new Error('createScriptNode is disabled in non-Node.js environment'));
|
|
710
|
+
};
|
|
711
|
+
const loadScriptNode = typeof ENV_TARGET === 'undefined' || ENV_TARGET !== 'web' ? (url, info)=>{
|
|
710
712
|
return new Promise((resolve, reject)=>{
|
|
711
713
|
createScriptNode(url, (error, scriptContext)=>{
|
|
712
714
|
if (error) {
|
|
@@ -719,7 +721,9 @@ function loadScriptNode(url, info) {
|
|
|
719
721
|
}
|
|
720
722
|
}, info.attrs, info.loaderHook);
|
|
721
723
|
});
|
|
722
|
-
}
|
|
724
|
+
} : (url, info)=>{
|
|
725
|
+
throw new Error('loadScriptNode is disabled in non-Node.js environment');
|
|
726
|
+
};
|
|
723
727
|
async function loadModule(url, options) {
|
|
724
728
|
const { fetch: fetch1, vm } = options;
|
|
725
729
|
const response = await fetch1(url);
|
package/dist/src/node.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CreateScriptHookNode, FetchHook } from './types';
|
|
2
|
-
export declare
|
|
2
|
+
export declare const createScriptNode: (url: string, cb: (error?: Error, scriptContext?: any) => void, attrs?: Record<string, any>, loaderHook?: {
|
|
3
3
|
createScriptHook?: CreateScriptHookNode;
|
|
4
4
|
fetch?: FetchHook;
|
|
5
|
-
})
|
|
6
|
-
export declare
|
|
5
|
+
}) => void;
|
|
6
|
+
export declare const loadScriptNode: (url: string, info: {
|
|
7
7
|
attrs?: Record<string, any>;
|
|
8
8
|
loaderHook?: {
|
|
9
9
|
createScriptHook?: CreateScriptHookNode;
|
|
10
10
|
};
|
|
11
|
-
})
|
|
11
|
+
}) => Promise<void>;
|
|
@@ -197,6 +197,19 @@ export interface ModuleFederationPluginOptions {
|
|
|
197
197
|
externalRuntime?: boolean;
|
|
198
198
|
provideExternalRuntime?: boolean;
|
|
199
199
|
asyncStartup?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Options related to build optimizations.
|
|
202
|
+
*/
|
|
203
|
+
optimization?: {
|
|
204
|
+
/**
|
|
205
|
+
* Enable optimization to skip snapshot plugin
|
|
206
|
+
*/
|
|
207
|
+
disableSnapshot?: boolean;
|
|
208
|
+
/**
|
|
209
|
+
* Target environment for the build
|
|
210
|
+
*/
|
|
211
|
+
target?: 'web' | 'node';
|
|
212
|
+
};
|
|
200
213
|
};
|
|
201
214
|
bridge?: {
|
|
202
215
|
/**
|
|
@@ -25,7 +25,6 @@ export interface BasicProviderModuleInfo extends BasicModuleInfo {
|
|
|
25
25
|
remoteEntryType: RemoteEntryType;
|
|
26
26
|
ssrRemoteEntry?: string;
|
|
27
27
|
ssrRemoteEntryType?: RemoteEntryType;
|
|
28
|
-
remoteManifest?: string;
|
|
29
28
|
globalName: string;
|
|
30
29
|
modules: Array<{
|
|
31
30
|
moduleName: string;
|