asyncRequire: wrap result in default

Reviewed By: cpojer

Differential Revision: D6911464

fbshipit-source-id: 44953e0716e076e50d551738059435697d064733
This commit is contained in:
Jean Lauliac 2018-02-08 08:58:44 -08:00 committed by Facebook Github Bot
parent 43a7caf90a
commit 01a92f3c2f
1 changed files with 1 additions and 1 deletions

View File

@ -15,5 +15,5 @@
// eslint-disable-next-line flow-no-fixme
const dynamicRequire = (require: $FlowFixMe);
module.exports = function(moduleID: mixed): Promise<mixed> {
return Promise.resolve(dynamicRequire(moduleID));
return Promise.resolve().then(() => ({default: dynamicRequire(moduleID)}));
};