RN local-cli: fix saveAsset scales filtering
Reviewed By: fkgozali Differential Revision: D5688676 fbshipit-source-id: 2cf6d08b626a6e8c55db0b2293e13300f9606332
This commit is contained in:
parent
6493a85754
commit
b6e0f4a12d
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue