From 82e8d71e79004bf2d0367bd2820b8033ce9761ef Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Mon, 13 Mar 2017 14:19:46 -0400 Subject: [PATCH] Set __esModule flag on import(...) namespace objects. This small tweak would have made this commit unecessary: https://github.com/meteor/react-loadable-example/commit/1fac2ff3c159ae49da7d24f343dec9b71e630c79 Because we've already done the translation from CommonJS module.exports to ES2015 namespace object, this flag should always be true. --- packages/dynamic-import/client.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/dynamic-import/client.js b/packages/dynamic-import/client.js index b6282fb6c4..cf04e8a304 100644 --- a/packages/dynamic-import/client.js +++ b/packages/dynamic-import/client.js @@ -178,5 +178,12 @@ function getNamespace(module, id) { } }); + // This helps with Babel interop, since we're not just returning the + // module.exports object. + Object.defineProperty(namespace, "__esModule", { + value: true, + enumerable: false + }); + return namespace; }