mirror of https://github.com/status-im/metro.git
Expose getDependencies when using RAM bundles
Reviewed By: rafeca Differential Revision: D6965192 fbshipit-source-id: 8f4178aa4c38c03beab6da8bcaf4dc193c02b044
This commit is contained in:
parent
918e1a384c
commit
892b4ac9de
|
@ -37,6 +37,7 @@ export type Options = BundleOptions & {
|
|||
export type RamModule = ModuleTransportLike;
|
||||
|
||||
export type RamBundleInfo = {
|
||||
getDependencies: string => Set<string>,
|
||||
startupModules: $ReadOnlyArray<RamModule>,
|
||||
lazyModules: $ReadOnlyArray<RamModule>,
|
||||
groups: Map<number, Set<number>>,
|
||||
|
@ -218,9 +219,10 @@ async function getRamBundleInfo(
|
|||
);
|
||||
|
||||
return {
|
||||
startupModules,
|
||||
lazyModules,
|
||||
getDependencies,
|
||||
groups,
|
||||
lazyModules,
|
||||
startupModules,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -117,6 +117,7 @@ Array [
|
|||
|
||||
exports[`Serializers should return the RAM bundle info 1`] = `
|
||||
Object {
|
||||
"getDependencies": [Function],
|
||||
"groups": Map {},
|
||||
"lazyModules": Array [
|
||||
Object {
|
||||
|
@ -191,6 +192,7 @@ Object {
|
|||
|
||||
exports[`Serializers should return the RAM bundle info 2`] = `
|
||||
Object {
|
||||
"getDependencies": [Function],
|
||||
"groups": Map {},
|
||||
"lazyModules": Array [
|
||||
Object {
|
||||
|
@ -403,6 +405,7 @@ Object {
|
|||
|
||||
exports[`Serializers should use the preloadedModules and ramGroup configs to build a RAM bundle 1`] = `
|
||||
Object {
|
||||
"getDependencies": [Function],
|
||||
"groups": Map {
|
||||
5 => Set {
|
||||
6,
|
||||
|
|
|
@ -338,8 +338,9 @@ exports.runBuild = async ({
|
|||
|
||||
try {
|
||||
metroBundle = await output.build(metroServer, requestOptions);
|
||||
} finally {
|
||||
} catch (error) {
|
||||
await metroServer.end();
|
||||
throw error;
|
||||
}
|
||||
|
||||
if (onComplete) {
|
||||
|
@ -358,6 +359,7 @@ exports.runBuild = async ({
|
|||
};
|
||||
|
||||
await output.save(metroBundle, outputOptions, console.log);
|
||||
await metroServer.end();
|
||||
|
||||
return {metroServer, metroBundle};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue