Updates from Fri 8 May

This commit is contained in:
Alex Kotliarskyi 2015-05-08 10:29:59 -07:00
commit d93f66ca23
2 changed files with 6 additions and 5 deletions

View File

@ -166,12 +166,12 @@ describe('Packager', function() {
};
expect(p.addModule.mock.calls[3][0]).toEqual({
code: 'lol module.exports = ' +
code: 'lol module.exports = require("AssetRegistry").registerAsset(' +
JSON.stringify(imgModule) +
'; lol',
sourceCode: 'module.exports = ' +
'); lol',
sourceCode: 'module.exports = require("AssetRegistry").registerAsset(' +
JSON.stringify(imgModule) +
';',
');',
sourcePath: '/root/img/new_image.png'
});

View File

@ -219,7 +219,8 @@ Packager.prototype.generateAssetModule = function(ppackage, module) {
ppackage.addAsset(img);
var code = 'module.exports = ' + JSON.stringify(img) + ';';
var ASSET_TEMPLATE = 'module.exports = require("AssetRegistry").registerAsset(%json);';
var code = ASSET_TEMPLATE.replace('%json', JSON.stringify(img));
return new ModuleTransport({
code: code,