mirror of https://github.com/status-im/metro.git
Updates from Fri 8 May
This commit is contained in:
commit
d93f66ca23
|
@ -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'
|
||||
});
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue