mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 19:44:13 +00:00
Return concrete file paths to the client
Reviewed By: @martinbigio Differential Revision: D2465182
This commit is contained in:
parent
c4cb95f2d7
commit
30cca276fa
@ -217,6 +217,12 @@ describe('AssetServer', () => {
|
|||||||
type: 'png',
|
type: 'png',
|
||||||
name: 'b',
|
name: 'b',
|
||||||
scales: [1, 2, 4, 4.5],
|
scales: [1, 2, 4, 4.5],
|
||||||
|
files: [
|
||||||
|
'/root/imgs/b@1x.png',
|
||||||
|
'/root/imgs/b@2x.png',
|
||||||
|
'/root/imgs/b@4x.png',
|
||||||
|
'/root/imgs/b@4.5x.png',
|
||||||
|
],
|
||||||
hash: 'wow such hash',
|
hash: 'wow such hash',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -253,6 +259,12 @@ describe('AssetServer', () => {
|
|||||||
type: 'jpg',
|
type: 'jpg',
|
||||||
name: 'b',
|
name: 'b',
|
||||||
scales: [1, 2, 4, 4.5],
|
scales: [1, 2, 4, 4.5],
|
||||||
|
files: [
|
||||||
|
'/root/imgs/b@1x.jpg',
|
||||||
|
'/root/imgs/b@2x.jpg',
|
||||||
|
'/root/imgs/b@4x.jpg',
|
||||||
|
'/root/imgs/b@4.5x.jpg',
|
||||||
|
],
|
||||||
hash: 'wow such hash',
|
hash: 'wow such hash',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -60,6 +60,7 @@ class AssetServer {
|
|||||||
|
|
||||||
return this._getAssetRecord(assetPath, platform).then(record => {
|
return this._getAssetRecord(assetPath, platform).then(record => {
|
||||||
data.scales = record.scales;
|
data.scales = record.scales;
|
||||||
|
data.files = record.files;
|
||||||
|
|
||||||
return Promise.all(
|
return Promise.all(
|
||||||
record.files.map(file => stat(file))
|
record.files.map(file => stat(file))
|
||||||
|
1
packager/react-packager/src/Bundler/index.js
vendored
1
packager/react-packager/src/Bundler/index.js
vendored
@ -268,6 +268,7 @@ class Bundler {
|
|||||||
width: dimensions.width / module.resolution,
|
width: dimensions.width / module.resolution,
|
||||||
height: dimensions.height / module.resolution,
|
height: dimensions.height / module.resolution,
|
||||||
scales: assetData.scales,
|
scales: assetData.scales,
|
||||||
|
files: assetData.files,
|
||||||
hash: assetData.hash,
|
hash: assetData.hash,
|
||||||
name: assetData.name,
|
name: assetData.name,
|
||||||
type: assetData.type,
|
type: assetData.type,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user