Return concrete file paths to the client

Reviewed By: @martinbigio

Differential Revision: D2465182
This commit is contained in:
Amjad Masad 2015-09-22 15:43:24 -07:00 коммит произвёл facebook-github-bot-5
Родитель c4cb95f2d7
Коммит 30cca276fa
3 изменённых файлов: 14 добавлений и 0 удалений

Просмотреть файл

@ -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,