mirror of https://github.com/status-im/metro.git
Fix creation of indexed RAM bundles
Reviewed By: jeanlauliac Differential Revision: D5852737 fbshipit-source-id: 98e16fbd69d9ad3666acfc86e5de308175102643
This commit is contained in:
parent
f6e2e17900
commit
3f2b200e01
|
@ -13,7 +13,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const buildSourceMapWithMetaData = require('../../shared/output/unbundle/build-unbundle-sourcemap-with-metadata.js');
|
const buildSourceMapWithMetaData = require('../../shared/output/unbundle/build-unbundle-sourcemap-with-metadata.js');
|
||||||
const nullthrows = require('fbjs/lib/nullthrows');
|
|
||||||
|
|
||||||
const {createRamBundleGroups} = require('../../Bundler/util');
|
const {createRamBundleGroups} = require('../../Bundler/util');
|
||||||
const {
|
const {
|
||||||
|
@ -64,8 +63,8 @@ function asIndexedRamBundle({
|
||||||
function* subtree(moduleTransport, moduleTransportsByPath, seen = new Set()) {
|
function* subtree(moduleTransport, moduleTransportsByPath, seen = new Set()) {
|
||||||
seen.add(moduleTransport.id);
|
seen.add(moduleTransport.id);
|
||||||
for (const {path} of moduleTransport.dependencies) {
|
for (const {path} of moduleTransport.dependencies) {
|
||||||
const dependency = nullthrows(moduleTransportsByPath.get(path));
|
const dependency = moduleTransportsByPath.get(path);
|
||||||
if (!seen.has(dependency.id)) {
|
if (dependency && !seen.has(dependency.id)) {
|
||||||
yield dependency.id;
|
yield dependency.id;
|
||||||
yield* subtree(dependency, moduleTransportsByPath, seen);
|
yield* subtree(dependency, moduleTransportsByPath, seen);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue