Permalink
Browse files

RN local-cli: fix saveAsset scales filtering

Reviewed By: fkgozali

Differential Revision: D5688676

fbshipit-source-id: 2cf6d08b626a6e8c55db0b2293e13300f9606332
  • Loading branch information...
jeanlauliac authored and facebook-github-bot committed Aug 24, 2017
1 parent 6493a85 commit b6e0f4a12d817af6968cd1461e4f92f1bf996544
Showing with 7 additions and 3 deletions.
  1. +7 −3 local-cli/bundle/saveAssets.js
@@ -32,13 +32,17 @@ function saveAssets(
const filesToCopy = Object.create(null); // Map src -> dest
assets
.forEach(asset =>
filterPlatformAssetScales(platform, asset.scales).forEach((scale, idx) => {
.forEach(asset => {
const validScales = new Set(filterPlatformAssetScales(platform, asset.scales));
asset.scales.forEach((scale, idx) => {
if (!validScales.has(scale)) {
return;
}
const src = asset.files[idx];
const dest = path.join(assetsDest, getAssetDestPath(asset, scale));
filesToCopy[src] = dest;
})
);
});
return copyAll(filesToCopy);
}

0 comments on commit b6e0f4a

Please sign in to comment.