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',
|
||||
name: 'b',
|
||||
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',
|
||||
});
|
||||
});
|
||||
|
@ -253,6 +259,12 @@ describe('AssetServer', () => {
|
|||
type: 'jpg',
|
||||
name: 'b',
|
||||
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',
|
||||
});
|
||||
});
|
||||
|
|
|
@ -60,6 +60,7 @@ class AssetServer {
|
|||
|
||||
return this._getAssetRecord(assetPath, platform).then(record => {
|
||||
data.scales = record.scales;
|
||||
data.files = record.files;
|
||||
|
||||
return Promise.all(
|
||||
record.files.map(file => stat(file))
|
||||
|
|
|
@ -268,6 +268,7 @@ class Bundler {
|
|||
width: dimensions.width / module.resolution,
|
||||
height: dimensions.height / module.resolution,
|
||||
scales: assetData.scales,
|
||||
files: assetData.files,
|
||||
hash: assetData.hash,
|
||||
name: assetData.name,
|
||||
type: assetData.type,
|
||||
|
|
Loading…
Reference in New Issue