packager: buck library: expose asset content

Reviewed By: davidaurelio

Differential Revision: D4945778

fbshipit-source-id: ea132a3d284ed09c59c69afbdd7b707af9e521b9
This commit is contained in:
Jean Lauliac 2017-04-25 11:49:41 -07:00 committed by Facebook Github Bot
parent b58e5dc930
commit 82dcddcb12
2 changed files with 10 additions and 2 deletions

View File

@ -68,7 +68,7 @@ export type GetTransformOptions = (
getDependenciesOf: string => Promise<Array<string>>,
) => Promise<ExtraTransformOptions>;
type AssetDescriptor = {
export type AssetDescriptor = {
+__packager_asset: boolean,
+httpServerLocation: string,
+width: ?number,
@ -79,7 +79,7 @@ type AssetDescriptor = {
+type: string,
};
type ExtendedAssetDescriptor = AssetDescriptor & {
export type ExtendedAssetDescriptor = AssetDescriptor & {
+fileSystemLocation: string,
+files: Array<string>,
};

View File

@ -140,3 +140,11 @@ export type LibraryOptions = {|
platform?: string,
root: string,
|};
export type Base64Content = string;
export type Library = {|
files: Array<TransformedFile>,
/* cannot be a Map because it's JSONified later on */
assets: {[destFilePath: string]: Base64Content},
|};