mirror of https://github.com/status-im/metro.git
Update node-haste dependency to 2.12.0
Summary: Update to node-haste 2.12.0 to support pass through configuration of supported platforms. Closes https://github.com/facebook/react-native/pull/7660 Differential Revision: D3335034 Pulled By: mkonicek fbshipit-source-id: d238b90a90d51654301d61251ceb26d183fef57a
This commit is contained in:
parent
fd40670869
commit
69a46e2c6e
|
@ -51,7 +51,7 @@ class AssetServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
get(assetPath, platform = null) {
|
get(assetPath, platform = null) {
|
||||||
const assetData = getAssetDataFromName(assetPath);
|
const assetData = getAssetDataFromName(assetPath, new Set([platform]));
|
||||||
return this._getAssetRecord(assetPath, platform).then(record => {
|
return this._getAssetRecord(assetPath, platform).then(record => {
|
||||||
for (let i = 0; i < record.scales.length; i++) {
|
for (let i = 0; i < record.scales.length; i++) {
|
||||||
if (record.scales[i] >= assetData.resolution) {
|
if (record.scales[i] >= assetData.resolution) {
|
||||||
|
@ -64,7 +64,7 @@ class AssetServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
getAssetData(assetPath, platform = null) {
|
getAssetData(assetPath, platform = null) {
|
||||||
const nameData = getAssetDataFromName(assetPath);
|
const nameData = getAssetDataFromName(assetPath, new Set([platform]));
|
||||||
const data = {
|
const data = {
|
||||||
name: nameData.name,
|
name: nameData.name,
|
||||||
type: nameData.type,
|
type: nameData.type,
|
||||||
|
@ -115,7 +115,7 @@ class AssetServer {
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const dir = res[0];
|
const dir = res[0];
|
||||||
const files = res[1];
|
const files = res[1];
|
||||||
const assetData = getAssetDataFromName(filename);
|
const assetData = getAssetDataFromName(filename, new Set([platform]));
|
||||||
|
|
||||||
const map = this._buildAssetMap(dir, files, platform);
|
const map = this._buildAssetMap(dir, files, platform);
|
||||||
|
|
||||||
|
@ -166,8 +166,8 @@ class AssetServer {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_buildAssetMap(dir, files) {
|
_buildAssetMap(dir, files, platform) {
|
||||||
const assets = files.map(getAssetDataFromName);
|
const assets = files.map(this._getAssetDataFromName.bind(this, new Set([platform])));
|
||||||
const map = Object.create(null);
|
const map = Object.create(null);
|
||||||
assets.forEach(function(asset, i) {
|
assets.forEach(function(asset, i) {
|
||||||
const file = files[i];
|
const file = files[i];
|
||||||
|
@ -194,6 +194,10 @@ class AssetServer {
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_getAssetDataFromName(platform, file) {
|
||||||
|
return getAssetDataFromName(file, platform);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAssetKey(assetName, platform) {
|
function getAssetKey(assetName, platform) {
|
||||||
|
|
Loading…
Reference in New Issue